Rob Street's first-half penalty and a late effort from Tom Bayliss secured City a win at Mansfield Town to make it 16 matches unbeaten in Sky Bet League One.
Forward Street calmly dispatched his eighth goal of the season, after Jack Moylan had been fouled in the area.
Then, moments before the final whistle, substitute Bayliss capped the result by converting his third of the season from close range after good work from Dom Jefferies.
There was almost an opening for City in the fourth minute as a long throw from Tom Hamer found Moylan in the box, who worked space before aiming an effort towards goal, but his shot was charged down.
Soon after, Moylan was at the heart of the attack again for the Imps as he drove through the middle and into the box before taking aim, but his shot was deflected for a corner. The set-piece was delivered by Ivan Varfolomeev, but headed clear by Rhys Oates.
With 18 minutes played, a free kick was lofted into the path of Sonny Bradley, who forced a save from Liam Roberts.
In the 22nd minute there was a brilliant driving run through the middle from Conor McGrandles, who laid it out wide for Reeco Hackett. He picked out Varfolomeev who took aim from 25 yards out, but his strike was just off target.
As the away side continued to be dominant, Adam Reach drilled a low cross towards Street on 24 minutes, who couldn't quite make contact to turn the ball towards goal.
A minute later, the Stags had their best opening of the game so far as Oates found the head of Stephen McLaughlin from the right flank, but his header was off target.
Shortly after that, Oates caused problems down the left flank and very nearly picked out Will Evans at the back post, but Reach was there to make a crucial interception to prevent him from scoring.
Three minutes before the half-time break, Moylan was tripped in the box by Evans and City were awarded a penalty. Street stepped up and slotted past Roberts, who dived the right way but couldn't stop the shot.
Just after the restart, a fortunate bounce of the ball for the home side saw Evans go through on goal, but George Wickens raced out of his goal to close the space and make an excellent save to deny Mansfield a leveller.
On 57 minutes, Frazer Blake-Tracy rose highest to meet a corner for the hosts from Aaron Lewis, but couldn't direct his header on target.
Three minutes after, there was another chance from a corner, but this time for City. Varfolomeev sent in the delivery, which Sonny Bradley met with a header, but it was saved.
As Mansfield pushed for a leveller, Oates advanced into the area and looked to lift the ball over Wickens, but the goalkeeper was equal to the effort, which bounced back off the striker. The Stags wanted a penalty, but the referee was unmoved.
With 70 minutes on the clock, Moylan progressed down the left and stood the ball up to the back post for Street, who met with a firm header that was just off target.
Following a triple City change, there was an opening for Mansfield through McLaughlin, but his effort was way off target.
Then, on 80 minutes, Tyler Roberts tumbled in the box under pressure and appealed for a penalty, but there didn't look to be much in it and the referee waved play on.
There was a big chance for the Stags as the game entered six minutes of added time. The ball broke for Louis Reed to strike after a corner was only partially cleared. The midfielder caught it well, but his strike was just wide of the target.
While the hosts had pressed for a leveller, the Imps were equal to everything thrown at them and they capped the three points in the 95th minute.
It was a brilliant counter attack from City as substitute Jefferies raced to the left byline and put the ball it on a plate for the onrushing Bayliss, who converted from close range to seal the success.
Imps: Wickens, Darikwa, Reach, Hackett (Jefferies, 71), Moylan (Towler, 71), McGrandles, Bradley, Street (Lloyd, 85), House (Oné, 71), Hamer, Varfolomeev (Bayliss, 78).
Substitutes not used: Jeacock, Elerewe.
Mansfield: L. Roberts, Blake-Tracy, Oshilaja, Knoyle (Hewitt, 46), McLaughlin, Lewis (Abbott, 79), Reed, Akins, Evans (T. Roberts, 65), Moriah-Welsh (Russell, 46), Oates.
Substitutes not used: Adeboyejo, Bolton, Irow.
Attendance: 9,050 (1,649 away).