Keen to upset the visitor’s push for the play-offs, Town took the lead inside the opening 20 minutes when Bevis Mugabi grabbed just his second goal of the season from a set-piece.
Playing with freedom and confidence, the Glovers enjoyed the better of the remainder of the first half and comfortably took their lead into the break.
A frantic affair after the restart, Mansfield levelled on 49 minutes through Lee Angol before Francois Zoko restored Yeovil’s lead from the penalty spot.
Repeating the feat at the other end, Kane Hemmings converted from 12 yards to make it 2-2, as Angol then dispatched a sublime free-kick to complete the turnaround and keep the Stags’ play-off hopes alive.
Looking to sign off in Somerset in style, Darren Way made two changes from the side that secured mathematical safety in midweek.
Having initially been ruled out for the remainder of the season, Artur Krysiak made a timely comeback between the sticks to replace Jonny Maddison who missed out with an injury picked up in training.
Completing the changes, Connor Smith came in for a first appearance since March taking the place of loanee Jared Bird in the centre of midfield.
Enjoying good home form for the majority of the campaign, the Green & whites came into the last outing looking for a first win in six in front of the home faithful but almost found themselves behind after just five minutes.
Mal Benning’s corner found Paul Digby stooping at the near post, but the full-back’s header only rippled the side netting.
Surviving the early scare, Town grew into the match and soon enjoyed a spell of pressure which resulted in the game’s opening goal.
Lewis Wing’s deflected strike from range earned a flurry of corners and from Otis Khan’s second delivery in succession, Mugabi rose highest to head past a stranded Conrad Logan.
Breaking a run of five home games without a goal, the Glovers looked likely to add a second and remained on the front foot against David Flitcroft’s play-off hopefuls.
Playing some neat football, Jordan Green tested Logan just past the half-hour mark when his shot from the angle had to be palmed away whilst Zoko continued to look threatening.
Keeping Krysiak as merely a spectator, Mansfield cut a frustrated side in the opening 45 minutes as the Glovers held them at arm’s length.
Only penetrating the home side’s box on one occasion, Kane Hemmings’ shot from the angle was brilliantly blocked by Omar Sowunmi to only concede a corner as opposed to an undeserved equaliser.
Needing a win in Somerset to keep their hopes of a top seven finish intact, the Nottinghamshire outfit introduced striker Angol for the second half and almost drew level moments after the restart.
Benning’s cross from the left could only be glanced into the path of Danny Rose by Sowunmi, but Mansfield’s top scorer volleyed over the bar from 12 yards with the goal begging.
However, a different side after the break the Stags continued their onslaught and drew level on 49 minutes with Angol making an instant impact.
Looking to make amends for his miss moments earlier Rose was denied from close range by Krysiak, but the ball squirted into the path of the substitute Angol who just about bundled the ball over the line despite the last-ditch efforts of C. Smith.
Seemingly becoming a difficult second period for the hosts, Way’s side responded in positive fashion when Tom James had a 30-yard free-kick just about kept out by Logan before Town did retake the lead before the hour-mark.
Awarded a penalty when Sowunmi was bundled over in the box by Krystian Pearce, captain Zoko stepped up to confidently dispatch his 15th of the season to restore the lead.
Becoming an action-packed second 45 minutes, referee Charles Breakspear pointed to the spot for a second time 10 minutes later, this time in favour of the Stags.
Angol’s free-kick was adjudged to have been blocked by a hand in the wall, giving Hemmings the chance – which he didn’t turn down – to level it up once again.
One of the most entertaining encounters of the season in Somerset, the hosts almost took the lead for a third time when James’ shot from outside the box had to be parried by the Stags stopper as the chances continued to flow.
Unfortunately for Town, the next chance resulted in a third for Mansfield.
Changing the game from the bench, Angol curled in a free-kick in off the bar to round off a 20-minute spell which yielded four goals and gave Flitcroft’s side the lead.
Desperate to get something from a fine performance the Glovers threw caution to the wind in the final 10 minutes and had a second penalty appeal waved away when Zoko went down in the middle, but defeat was confirmed when Sowunmi received a second yellow in stoppage time.
Yeovil Town: Krysiak; Mugabi, Sowunmi, Donnellan, James; Green (Browne 62′), Wing, C. Smith (Bird 79′), Khan; Fisher (Surridge 66′), Zoko.
Bookings: Fisher 8′, Surridge 68′, Sowunmi 90′ (red card for two yellows)
Subs not used: Phillips, N. Smith, Gobern, Seager.
Mansfield: Logan; Digby (King 90′), Pearce, Bennett, Benning; Potter (Hamilton 35′), Mellis, Atkinson (Angol 46′), MacDonald; Rose, Hemmings.
Bookings: MacDonald 26′, Benning 55′, Pearce 57′, Angol 90′
Subs not used: Olejnik, Byrom, Hunt, Graham.