Krystian Pearce's 96th minute winner earned ten-man Mansfield all three points late on at Blundell Park.
With time ticking away, the Stags' captain stabbed home from a Mal Benning free kick in the sixth minute of stoppage time to send the 681 travelling fans into raptures.
Hayden White was sent off after the referee had deemed his challenge on Jake Hessenthaler worthy of a red card, but the Stags withstood second half pressure before stealing the points in dramatic fashion.
Stags’ boss John Dempster made two changes to his side. Defender Hayden White came into the team ahead of Conor Shaughnessy and forward Nicky Maynard replaced winger CJ Hamilton.
The hosts started strongly and had a glorious chance to take the lead within the opening two minutes through Luke Waterfall. Jake Hessenthaler found James Hanson at the back post. The towering striker cushioned the ball back across the six-yard box into the path of Waterfall, but Logan was there to deny him. The pressure was eventually relieved when Max Wright’s cross sailed over everybody in the box and away to safety.
The hosts were the better side in the opening exchanges and were adamant they should have had a penalty on 13 minutes, when Moses Ogbu’s powerful drive struck Pearce. The referee waved away the claims for handball and pointed for a corner, which was comfortably cleared by Neal Bishop.
The Stags were then looking nervously over to the officials again shortly after. Jordan Cook sent in a looping cross for Hanson who directed the ball past Logan and wheeled away in celebration, only to find the assistant referee had raised his flag for offside.
On 18 minutes, Hanson was there again, heading narrowly wide from Hessenthaler’s beautifully weighted corner as the hosts looked to turn the screw. Defender Harry Davis then sent a defence-splitting pass over the top and Hanson raced clear of Pearce. Bearing down on goal, the striker managed to hook the ball over Logan but luckily for the amber and blue it went wide of the post.
The Stags' best opening of the early exchanges came after 22 minutes. Industrious work from Danny Rose down the right-channel fashioned an opportunity for Alex Macdonald. Unfortunately, his rasping drive was inadvertently blocked by his own teammate Nicky Maynard. The ball broke to Bishop who fired wide from 25 yards.
Mansfield’s best moment of the half came on the half-hour-mark and it should have brought the opening goal. Otis Khan found himself in a pocket of space and skipped past two defenders, with the second hacking him down to concede a free-kick. From the resulting set piece, he swung a right footed delivery onto the head of Rose, but the striker could only direct his effort into the hands of the grateful James McKeown in the Grimsby goal.
The first chance of note fell to the visitors on 48 minutes. Again, Khan found himself in a central position with time and space but could only fire straight at McKeown from 25 yards. Mal Benning then fizzed an effort over for the Stags on 57 minutes as they began to get a foothold in the contest.
The game appeared to swing the hosts' way on the hour mark, when Mansfield were reduced to ten men. Hayden White appeared to get his foot to the ball, but the referee deemed his challenge on Jake Hessenthaler as dangerous and showed him a red card.
John Dempster responded by switching to a 4-4-1 formation as he looked to solidify the defensive shape of his side. Hanson was again causing problems for Stags’ back-line and it took two crucial blocks from Ryan Sweeney to deny him an opening on 72 minutes. Firstly, the managed to block the striker’s goal bound header, before again getting himself in the way to deny him a second time.
The Stags responded on 76 minutes as substitute CJ Hamilton rode the challenge of Luke Hendrie before crossing low, but he couldn’t find Khan who was lurking menacingly in the box.
The amber and blue were defending bravely, and this was epitomised by Kellan Gordan who blocked Ahkeem Rose’s cross on 78 minutes. He was then called into action again to make a crucial interception from Hanson with the striker six yards from goal.
The away side were having to sustain heavy pressure and Rose squandered an opportunity down the left when he failed to find a Grimsby shirt, with his teammates queuing up in the box. Benning was again there to make a heroic interception in added time, with the ball looking certain to find a Mariners attacker.
This would prove crucial, as Mansfield then won the game deep into injury time. CJ Hamilton breezed past Luke Hendrie who was forced to hack him down. Benning swung in the subsequent free-kick and from the resulting goalmouth scramble, Pearce was there to force the ball home to spark jubilant scenes of celebration.
There was not time for the shell-shocked Mariners to respond as Mansfield clung on to claim a dramatic victory.
GRIMSBY XI: McKeown (GK), Hendrie, Gibson, Davis, Waterfall, Robson, Wright (Green 27), Hessenthaler, Ogbu (Rose 76), Cook (Whitehouse 85), Hanson.
UNUSED SUBS: Clifton, Russell (GK), Pollock, Hewitt, Rose.
STAGS XI: Logan (GK), White, Pearce, Bishop, MacDonald, Khan (Shaughnessy 85), Maynard (Hamilton 63), Sweeney, Gordon, Rose (Cook 83), Benning.
UNUSED SUBS: Tomlinson, Afolayan, Smith, Stone (GK)
REFEREE: Paul Marsden
ASSISTANTS: Richard Wigglesworth, Ian Smedley.
FOURTH OFFICIAL: Alix Pashley.
ATTENDANCE: 5087 (681)