Wrexham needed a slice of fortune to hang on to second place, as Lincoln defender Tendayi Darikwa diverted a shot into his own net to decide a tight League One encounter.
Paudie O'Connor almost gave Lincoln an early lead from a whipped free-kick but saw his goal-bound header well saved by Callum Burton, before another Imps set piece was stabbed just wide by Bailey Cadamarteri.
On the stroke of half-time it was Wrexham who nearly broke the deadlock when Lewis Brunt connected with James McClean's cross, only to see his header hit the crossbar.
After the break, Lincoln keeper George Wickens was kept busy by Ollie Palmer but was helpless when Darikwa deflected McClean's fierce shot into his own net to gift Wrexham victory.
The Imps have now lost to the top two in quick succession, following defeat to leaders Wycombe Wanderers at the weekend, and drop to ninth.
Wrexham remain in second a point ahead of Birmingham City, who won at Exeter City on Tuesday, but have played two games more.
Wrexham manager Phil Parkinson said:
"We always knew it would be that type of game because Lincoln are a good team, they're a strong League One outfit, did well at the back end of last year and had a good start to the season.
"There was a similar feel to the Huddersfield game, it was always going to be tight and one moment separated the two teams on the night.
"We've had some great chances to make the game look more comfortable but... that was a real gritty performance, and it had to be because they're a good side."