Lincoln City 1 Mansfield Town 2
The Stags found it hard going early on, but after taking the lead early in the second half they always looked the more likely winners.
Lincoln got back into the game with a controversial penalty, but the Stags grabbed an injury-time minute winner to ease their troubles at the bottom of League Two.
Lincoln created the better chances early on and teenager Lenell John-Lewis broke clear in the second minute but saw his shot saved by Carl Muggleton.
When Lincoln threatened again, Stags defender Johnny Mullins made a great interception to keep out Jamie Forrester.
Lincoln's Louis Dodds shot wide from a good position, before Nat Brown sent in a 35-yard effort which flew narrowly over the top.
Lincoln's best chance of the first half came in the 42nd minute when a perfect free-kick from Paul Green found the head of Lee Beevers, but the defender's effort was pushed over by Muggleton.
The second half was a different story with Mansfield going in front after 49 minutes.
Matt Hamshaw picked out Michael Boulding with a 30-yard pass and the striker hit a speculative ball into the box.
There appeared to be little danger, but Lincoln keeper Alan Marriott allowed the ball to go under his diving body and into the net to leave the home team stunned.
Lincoln fought back and drew level on the hour when Forrester was knocked off the ball inside the box by Town skipper Jake Buxton.
Referee Phil Dowd awarded the spot-kick despite Mansfield's protest and Forrester picked himself up to send the penalty low into the bottom corner.
Mansfield went onto dominate the latter stages and new signing Will Atkinson wasted a half-chance when he shot straight at Marriott.
Substitute Ian Holmes smashed an 81st minute shot against the bar before Mansfield grabbed the winner in the third minute of stoppage time.
Holmes flicked the ball on for Boulding to out-pace the Lincoln defence before firing home.