Paul Mullin's controversial late goal left Mansfield deep in the relegation mire as Stanley made it three wins from four games with their first victory at Field Mill for 51 years.
Mullin, looking offside, tapped in the 75th minute breakthrough – the first goal Mansfield had conceded at home for 533 minutes – to end Town's five match unbeaten home run.
All hopes of a home fight-back were ended in injury time when Andy Proctor converted a penalty, despite Stags' substitute Ian Holmes grabbing a late consolation deep into injury time.
In driving wind and rain, both sides made mistakes all over the park which lead to goal-scoring opportunities for both sides.
The Stags had squandered a great chance to grab an early lead when leading scorer Micky Boulding had the perfect opportunity to add to his 15-goal tally.
Boulding raced clear of the offside trap onto Matt Hamshaw's clever pass, but his third minute low drive was deflected over the bar by keeper Ian Dunbavin.
At the other end a fine saving tackle by the quick thinking Dan Martin denied Roscoe D'Sane a shot after a quick break away.
Three minutes before half-time the Stags wasted the best chance of the half. Nathan Arnold cut into the area and his drive was blocked by Dunbavin, before Jonathon D'Laryea's follow-up header was blocked on the line and Hamshaw scooped the loose ball over the bar from two yards.
Accrington went on to dominate after the break. Stags' keeper Carl Muggleton spilled a James Harris skidding shot and then a deep Mullin's cross found the unmarked John Miles at the far post, but his effort was well saved.
Muggleton again did well to hold onto another low Harris effort as the Stags struggled in the conditions.
But when he turned away yet another Harris drive 15 minutes from time, Mullins – looking offside – tapped in from close range.
In injury time Martin McIntosh was sent off for fouling Jay Harris inside the box, and Proctor tucked away the penalty.
And straight from the re-start, the Stags grabbed a consolation in injury time with Holmes sliding in Simon Brown's cross.