Jimmy Spencer, Josh Coulson and Ben Williamson netted for the Us, with James Berrett replying for York.
It could have been worse for the visitors, with former Barnsley midfielder Luke Berry missing a late penalty for the hosts.
Defeat leaves York just a point outside the bottom two.
Elsewhere, runaway leaders Northampton set a new club record of nine successive league wins with a 1-0 victory over Wycombe at Sixfields.
They reached the landmark courtesy of Danny Rose’s first goal for the club - a rising shot into the roof of the net from Lee Martin’s lay-off after 63 minutes.
The visitors created little and Cobblers goalkeeper Adam Smith was not really tested until he was called on to save a low effort from Anthony Stewart late on.
The result saw Wycombe drop out of the play-off places while the victory, combined with Plymouth’s 1-1 draw at Crawley, saw Northampton extend their lead at the top of the League Two table to 10 points.
Second-placed Plymouth fell further adrift after Ryan Brunt’s opening goal was cancelled out late on by Shamir Fenelon’s strike.
The other big game of the day saw fourth-placed Accrington win 2-1 at third-placed Oxford.
Chris Maguire put the hosts in front but Billy Kee headed the equalising goal for Stanley, who then had Tom Davies sent off six minutes from time. However, the 10 men nicked it in the 88th minute when Scott Brown fired in the winner to move his team to within three points of Oxford, with two games in hand.
Bristol Rovers, this week taken over by the Jordanian Al-Qadi family, climbed into the play-off positions with a 2-1 home victory over Morecambe.
Jamie Devitt’s penalty put Morecambe ahead but Rory Gaffney and substitute Billy Bodin turned the game on its head before Andrew Fleming was sent off for the visitors.
Mansfield and Portsmouth are the other two teams occupying the coveted top-seven spots and they played the division’s bottom two sides, with mixed results.
The Stags came from behind to Oliver Hawkins’ opener to beat Dagenham 3-2 at the One Call Stadium through goals from Matty Blair, Adi Yussuf and Matt Green. Krystian Pearce was then sent off for the hosts and Jamie Cureton missed the resulting penalty before finally getting his name on the scoresheet with four minutes left but it was too late for the Daggers who stay at the foot of the standings.
Yeovil got a useful point drawing 1-1 at home to Portsmouth. Francois Zoko put the Glovers ahead but Gary Roberts levelled for Pompey after they had Christian Burgess dismissed.
Yeovil are now just a point behind York.
Hartlepool also remain in trouble after losing 2-1 at Luton. Adam Jackson cancelled out Cameron McGeehan’s penalty but the Hatters regained the lead four minutes from time through sub Craig Mackail-Smith.
Leyton Orient’s rejuvenation under Kevin Nolan continued with a 1-0 win at Notts County thanks to Shaun Brisley’s 76th-minute goal. The O’s are now only outside the play-off places on goal difference.
It was also 1-0 at Brunton Park where a second-half header by Jabo Ibehre, his 15th goal of the season, was enough to earn Carlisle a scrappy 1-0 win over Stevenage.
Wimbledon edged the London derby with Barnet 2-1. Lyle Taylor and Adebayo Azeez netted for the Dons before Matt Stevens made it a nervy finale with three minutes left.
In the early kick-off, Exeter and Newport drew 1-1 as Scott Boden’s late header cancelled out Jordan Tillson’s opening goal for the Grecians.