York responded positively to their loss against Sutton by securing a 2-0 win against Oldham, who are vying for promotion in the Vanarama National League.
Early goals from Malachi Fagan-Walcott and Ollie Pearce propelled the Minstermen to within a point of league leaders Forest Green, with a game in hand.
Fagan-Walcott missed an early header opportunity, but he broke the deadlock in the 24th minute by scoring from a rebound off Alex Hunt's free-kick that had hit the post.
Pearce doubled the lead just before half-time, converting Joe Felix's cross to notch his 16th goal of the season.
Although Mike Fondop's header in the second half was saved by York's goalkeeper Harrison Male, Oldham's James Norwood missed a chance to score as they fell further behind, trailing by 10 points.