First-half goals from Ashley Chambers and Jason Walker gave York a comprehensive victory over Luton.
Chambers put the Minstermen ahead when he curled the ball into the top left-hand corner from just outside the area.
Walker doubled the lead when he placed his low 18-yard shot into the corner of the net, before crossing for Chambers to volley in from close range.
Luton came close when Jamie Hand shot over from close range, but could not find a way past the York defence.
York climb a place to fifth, above morning leaders Luton, who drop from first to sixth.
VIEWS FROM THE DRESSING ROOM
York City manager Gary Mills told BBC Radio York:
"If we do our jobs and do them well we win football matches and we've done it again today.
"We didn't get our rewards on Tuesday that I felt we deserved but we've gone and done it today and got the goals and the three points that we absolutely deserved.
"With the tempo we played today I thought we were superb."