Lincoln won for the first time in 16 games to climb off the bottom of the Football League.
City turned the form book upside down and controlled the first half before deservedly going in front just before the break.
County did hit back five minutes into the second half, levelling with a spectacular goal which looked to set them on the way to three points.
Lincoln however weathered the storm and a late goal gave them their first victory since August.
Lincoln created a string of early chances after only 60 seconds with Ben Wright going close with a header just over the bar.
Jamie Forrester then saw a low shot well saved by County keeper Kevin Pilkington. Pilkington was busy again minutes later, saving from Louis Dodds.
Lincoln were unlucky in the 31st minute when a free kick was flicked to Owain Warlow. The Welsh Under-21 International hit his shot well from outside the box but the ball flew inches over the crossbar.
Lincoln eventually broke the deadlock in the 43rd minute when veteran centre-back Adie Moses thumped a free kick into the box. The ball was deflected off a County defender to Wright who found himself unmarked six yards out. The striker made no mistake slotting the ball home sending the Imps ahead at the break.
Early in the second-half Pilkington did well to keep Dodds out after the Lincoln midfielder broke clear. But County equalised on 50 minutes when Gary Silk picked up the ball 25 yards out and hit a perfect shot into the top corner, giving Lincoln keeper Ben Smith no chance.
County then turned up the heat at Sincil Bank with Neil MacKenzie hitting a free kick narrowly over and Lawrie Dudfield making Smith work low down
Hector Sam then surprised Smith with a long-range effort but the keeper managed to save despite slipping in the mud.
The Imps got their winner 15 minutes from time when Lee Frecklington picked up the ball on the half-way line and ran at the County defence.
As the players backed off he exchanged passes with Wright before firing in a low shot which appeared to go under the body of Pilkington before crossing the goal line.