York ended a run of three successive draws by beating struggling Lincoln.
The home side made the perfect start when Danny Pilkington's 20-yard deflected volley flew past Imps keeper Paul Farman.
Lincoln's Jake Sheridan twice went close, but saw both of his efforts saved by Michael Ingham.
And the Minstermen doubled their lead when Patrick McLaughlin's strike from the edge of the box flew straight into the bottom corner.
VIEWS FROM THE DRESSING ROOM
York City manager Gary Mills told BBC Radio York:
"It's not the best we've played. We've played better. But we've kept a clean sheet and got two goals - both good finishes.
"A home game after three draws, I expressed it's important to get a win when you've done that, and we've done that.
"It's kept us up there. It was important and it's kept us up there. It was difficult again, was a windy night, but three points, fantastic."
Lincoln City manager David Holdsworth told BBC Lincolnshire:
"I didn't feel that we won enough personal battles, which was the challenge we threw down before the game, and I felt York probably shaded that tonight.
"They were tough conditions to play in and I felt we passed it well at times, so there were some positives to come out of it.
"We weren't beaten by a greater team. There were just aspects we could have improved on.
"I'm not despondent but I'd like us to compete more. I can't fault the commitment, we just need a bit more quality."