Carlisle United took a while to get going on a frustrating night and, in the end, their late fight back wasn't quite enough as Danny Rose won the tie for Mansfield with a wonder goal very late in the day.
Carlisle tried to use the McQueen outlet straight from the kick off but his run into the box was brought to a timely end by a good tackle from Benning.
Mansfield tried to settle their nerves by playing out from the back but it almost backfired when Grainger robbed possession and sprinted into the area. His low cross was half cleared before Shaun Miller could get there but Devitt was in attendance to try his luck. His shot had power but it rose over the bar.
United stayed forward and some unbelievable passing football ripped the Stags to pieces with Lambe at the heart of the action. McQueen arrived late but his shot from a tight angle was too close to Shearer.
The home midfield was very mobile through the early stages and a lovely ball over the top allowed Shaun Miller to beat the offside trap. He took a touch but was disappointed to see another fierce effort climb too high.
Mansfield made the home side pay for the missed chances when Clements took charge of a 40-yard free kick. He floated it to the back stick and Krystian Pearce did the rest as he picked his spot with a deft header.
The Stags went close again when Hemmings went wide to take charge of another set piece. His cross somehow beat everybody as it whipped across the face of the box.
It got worse for the home side just after the half hour when a defence splitting pass from Hamilton left Collins in acres of space and with time on his hands. He bore down on goal then clipped it low for Green to stab home from very close range.
Carlisle were almost gifted a goal in reply when Shearer took an age to decide what to do with a weak back pass. Lambe sprinted in and the shocked keeper was relieved to see the ricochet from his rushed clearance bounce wide of the upright.
Mansfield had the better of the second half opening exchanges but it was stuttering stuff until Benning found Green in a good position. The goal scorer tried his luck again but he dragged a poor attempt well wide.
The Stags stifled the play and stopped any signs of a head of steam from appearing as the referee's whistle took centre stage and the ball spent much of the half in the middle third much to the frustration of the home contingent.
But there was hope that the fightback might be on when Grainger curled a lovely delivery into the box. Shaun Miller made his move and his glanced header left Shearer with no chance as it buried itself into the bottom corner.
Another Grainger delivery caused more panic as Brisley challenged and the blue shirts stayed forward as they suddenly found a new lease of life. And it was all-square when a Grainger throw fell nicely for Wright. He got it back into the mix and, with Shearer stranded well off his line, Charlie Wyke made no mistake as he smashed goal number 13 into the net through a ruck of bodies.
Mansfield reclaimed the lead through a wonder strike from Danny Rose as he smacked an unstoppable shot into the top corner via the angle of post and bar, and they sat deep to keep their lead and secure their progression into the next round.
Carlisle United - S Miller (73), Wyke (80)
Mansfield Town - Pearce (14), Green (31), Rose (86)
Carlisle United - Joyce (33), S Miller (59)
Mansfield Town - Hamilton (45), Baxendale (77)
Carlisle United - Crocombe, T Miller, Brisley, Gillesphey, McQueen (Wyke 46), Joyce, McKee (Wright 45), Devitt, Grainger, Lambe (Asamoah 70), S Miller. Subs - Gillespie, Ellis, Kennedy, Adams.
Mansfield Town - Shearer, Bennett, Benning, Collins, Pearce, Clements, Green (Thomas 90), Baxendale (Rose 79), Hamilton, Hemmings (Hurst 70), McGuire. Subs - Jensen, Iacovitti, Gobern, Hakeem.
Referee - Mr David Webb
Attendance - 1,126 (41 away fans)