Joe Ironside struck with a header in the first minute of second-half stoppage time as the U's won their third consecutive match in all competitions.
Cambridge now sit on 30 points after 25 games following just their second victory in their last nine EFL League One games while Lincoln lost for the first time in three league encounters.
Story of the match
Mitov then tipped Liam Cullen's shot over the bar on 22 minutes and at the other end, Brophy picked out Ironside, but he could only shoot wide.
On the half hour mark, Worman was dispossessed in the middle of the park, Maguire collecting and moving forward to pull the trigger, which was denied by an astute block from Sherring.
Lincoln was dominating, Maguire forcing Mitov into a pair of saves and shortly after the restart, Whittaker dragged his effort just wide. At the other end, Ironside had a goal ruled out for offsides in the 58th minute.
Brophy found Sam Smith down the right and after he picked his spot, his low shot was gathered in by Griffiths. Moments later, Brophy hit a fierce shot that sailed just inches wide of the post.
With the match appearing to head for a scoreless draw, Cambridge found a winner in the 91st minute when Wes Hoolahan found May, his header saved by Griffiths, but Ironside converted the rebound.
Man of the match: Joe Ironside
His last-gasp winner, his team-leading 13th goal in all competitions, was a deserved reward for a performance in which he looked a threat throughout, constantly posing problems in attack for the Lincoln defence.