Brave Macclesfield Town held on for their first win in five games to keep alive their hopes of avoiding the dreaded drop to the Conference.
Two goals at the start of the second half put Paul Ince's side in charge and eventually took them six points clear of the drop zone, but only after the Stags came roaring back.
Mansfield, beaten at home by a relegation-threatened side for the second time in six days after a five-match unbeaten run had taken them to the fringe of the play-off hopefuls, finished the game with five strikers on the pitch.
But the closest they came to snatching a point to make amends for an inept first-half performance was when Barry Conlon headed against the post.
A couple of hundred Mansfield fans protested outside the ground before kick-off as part of an ongoing campaign to persuade chief executive Keith Haslam to sell the club.
Several hundred more also answered a call to boycott the match, with just over 2,000 home fans among the 2,414 attendance.
Macc, without an away win in 2007, were fortunate to escape in the opening minutes when Simon Brown burst clear of the offside trap.
But, after latching on to John Mullins' long pass, the Mansfield striker hesitated and his final shot was well saved by keeper Tommy Lee.
Brown again went close in the 16th minute by deflecting a fine cross from Nathan Arnold narrowly wide before his powerful shot from an acute angle was parried by the keeper.
However, with Macclesfield's long ball tactics upsetting the home side's passing football, the visitors began to take control either side of the break
Half-time substitute Ronayne Benjamin almost made an immediate impact as his 47th minute cross just eluded John Murphy.
But in the 54th minute John Miles pounced from eight yards to give Macclesfield the lead courtesy of more poor home defending after Matty McNeil seized on a weak Gareth Jelleyman clearance to create the goal.
Ironically, moments earlier Mansfield had finally posed a threat of their own by forcing three corners in a minute.
Arnold went close with one drive and then Stephen Dawson's piledriver was punched away by the alert Lee.
Macclesfield might have secured victory when home keeper Jason White missed a cross under pressure from McNeil, but the excellent Alex Baptiste came to the Stags' rescue.
They did double their lead though in the 66th minute. Miles had two shots well saved by keeper White and from the second rebound McNeil tapped in.
The goal finally spurred the Stags into life. Straight from the kick-off Conlon headed wide from Dawson's cross and then 60 seconds later Mullins nodded in a Matt Hamshaw corner.
Just two minutes later, Brown almost levelled but his fierce drive was blocked, before Baptiste's drive on the turn flashed inches wide when Lee flapped at a corner.
With the Stags pressing hard for an equaliser, Conlon headed against the post, keeper Lee spilled a Brown drive and Hamshaw's shot was deflected wide, but Macclesfield hung on for three priceless points.