After the game ended 2-2 after 90 minutes the Shrimps went through 6-5 on spot-kicks to earn a thrilling win.
Morecambe boss Jim Bentley made seven changes to the side that drew with Mansfield at the weekend and they started on the front foot with a goal on 18 minutes.
Lewis Alessandra swung over a corner from the left and central defender Steven Old was left unmarked as he headed past Conrad Logan from six yards out.
The cheers were short-lived however as the Shrimps were reduced to 10 men just four minutes later.
Luke Conlan was shown a straight red card for a rash challenge on Kellan Gordon after wrestling for possession with the Stags defender in the Mansfield penalty box.
The card changed the game and the rest of the half saw Mansfield dominate possession. Andy Cook went close to scoring on 25 minutes when he latched on to Mal Benning’s left-wing cross but saw his effort come back off the underside of the bar.
Mansfield finally worked their way back into the game on 57 minutes with an equaliser from Krystian Pearce.
Mark Halstead superbly saved Ryan Sweeney’s header but the ball fell to Pearce who headed home from six yards out.
The 10 men rallied though and were in front again two minutes later from another set-piece.
Jordan Cranston floated a free kick into the penalty area and Old nipped ahead of his marker again to direct a looping header over Logan from 12 yards out.
The home side stepped up the pace and levelled for the second time on 69 minutes when substitute Omari Sterling took the ball and in one swift movement turned and drilled a low shot past Halstead from the edge of the box.
Halstead made two fine late saves to deny Mansfield a normal time win to take the game to spot-kicks.
Shaun Miller missed the Shrimps’ first kick but Otis Khan then saw his effort saved by Halstead.
Sam Lavelle failed to find the target on the Shrimps’ fourth penalty but Cranston, John O’Sullivan, Adam Buxton, Alex Kenyon, Tom Brewitt and Old all scored theirs.
And as it went to sudden death ,Sweeney hit the crossbar with Mansfield’s eighth penalty and the Shrimps went through to an excellent win.
Mansfield: Logan, Gordon, White, Pearce, Benning, Khan, Donohue ( Tomlinson 46), Sweeney, Smith, Cook ( Rose 65), Hamilton ( Sterling 65). Subs not used: Stone, Clarke, Sinclair, Gibbens.
Morecambe: Halstead, Sutton ( Buxton 75), Lavelle, Old, Tanner, Brewitt, Cranston, Conlan, Oates ( O’Sullivan 75), Alessandra ( Kenyon 46), Miller. Subs not used: Roche, Jange, Stockton, Ellison.
Referee: R Lewis.