Goalkeeper Joe Anyon was on top form as Lincoln beat Hayes & Yeading to move five points clear of the drop zone.
After a quiet first half, Anyon made top-class saves to twice deny Luke Williams and then Jamie Hand.
The visitors went in front as Hayes goalkeeper Steve Arnold fluffed his clearance into Jefferson Louis' path.
Pedro Pele's header drew Hayes level, Tom Miller's close-range header put Lincoln ahead and Anyon denied Dwane Lee to frustrate the hosts again.
Lincoln are now five points clear of Hayes in the final Blue Square Bet Premier relegation place, while Hayes remain a point adrift of safety.
VIEWS FROM THE DRESSING ROOM
Lincoln City manager David Holdsworth told BBC Lincolnshire:
"It's wonderful for the players, I'm absolutely delighted. The effort we showed tonight was immense and the spirit and determination in the dressing room was outstanding.
"Our response to the equaliser was fantastic, you see some teams cave in but we got the winning goal from a well-worked set-piece so I'm pleased.
"In previous games Joe (Anyon) hasn't had too much to do, but when he was called on he got his body behind the ball. The pitch was awful but he did the technical part right and it was a solid performance.
"We've earned that victory. The players have shown great heart and while it still may be a rocky road we're on a clear path and our vision is bright."