Keith Lowe’s fifth goal of the season ensured this season’s team did not go into the Bootham Crescent history books alongside the class of 1981-82, who went 14 matches without a home win 33 years ago.
York also had to contend with on-loan Middlesbrough teenager Brad Halliday’s 61st-minute sending-off before celebrating their first home triumph of the campaign.
York rode their luck in the first half with unmarked centre-backs Tom Aldred and Rob Atkinson both heading over from free-kicks by Lee Molyneux.
Visiting pair Piero Mingoia and Matt Crooks also shot straight at goalkeeper Alex Cisak after being afforded free runs on the home goal.
But it was Russ Wilcox’s side who took a 1-0 lead into the interval after centre-back Lowe’s strike.
Lowe jumped high at the far post on 35 minutes to head in Michael Coulson’s free-kick from the left.
In the second half, Halliday received his marching orders for an ugly challenge on Aldred but the nearest Stanley went to claiming an equaliser was when Molyneux struck a post from 25 yards.
York might even have added to their lead with Jake Hyde firing over from the edge of the penalty box and fellow striker Wes Fletcher going close with a deflected effort after a powerful run through the left channel.
York City: Cisak; Halliday, Lowe, Zubar, Ilesanmi; Penn, Summerfield; Coulson, De Girolamo (McCoy, 62), Hyde (Carson, 85); Fletcher (Morris,74). Unused substitutes: Mooney, McCombe, Montrose, Meikle.
Accrington Stanley: Simpson; Hunt, Aldred, Atkinson, Winnard; Joyce, Procter (Windass, 78); Mingoia, Maguire (Gray, 72), Molyneux; Crooks (McCartan, 55).Unused substitutes: Liddle, Naismith, Dawber, Barry.
Referee: D Bond (Wigan).
Man of the match: Keith Lowe.