Rochdale fell to defeat for the first time at home since October on Tuesday night, following a cruel 1-0 loss to play-off chasing Mansfield Town.
In a game where a draw would have been a fair result, Jordan Bowery netted four minutes from time to win it for the Stags.
There were three changes to the side that lined-up against Leyton Orient at the weekend, as Paul Downing returned from injury to come into the eleven, replacing Jimmy Keohane, while Liam Kelly and Alex Newby made way for George Broadbent and Matty Done.
Stephen Quinn had the first effort of the game after six minutes, but his strike from the edge of the area proved comfortable for Jay Lynch.
And although end to end at times, Rochdale had the best of the opportunities during the half, which came early on.
Tahvon Campbell drove in on goal after Dale had won the ball high up the pitch and he fired a fierce shot narrowly over the bar from 20-yards.
Rochdale then built well again before Max Clark squared for Campbell who couldn’t quite make a clean connection to get his shot away and a Stags defender got a foot to the ball to steer it partially clear, but only as far as Ball, who saw his effort on the rebound deflected behind.
The visitors also got in on goal on occasion but without troubling.
Jamie Murphy struck over from the edge of the area after a well-worked move forward, while Rhys Oates, after Mansfield had capitalised on a lose ball, saw his low effort well-held by Lynch.
The forward then a dipping shot well held by the ‘keeper.
Rochdale were forced into their first change of the game four minutes before half-time, as Ball, who couldn’t continue due to injury, was replaced by Conor Grant.
Lynch denied Oates with his leg three minutes into the second half, after the Stags front man turned and got his shot away from close range.
Both Done and Campbell then had opportunities.
Done met Clark’s cross to the back post and had his volley held by Nathan Bishop, while Campbell, who had been played in by Grant, had a shot deflected wide.
A second substitution, again forced through injury, came shortly after the hour, with Alex Newby replacing Campbell.
Lynch had to be alert to get behind Oates’ powerful snapshot and he got his fists to it, to keep it out. Murphy then saw a low effort roll narrowly past the far post from a tight angle.
Grant, meanwhile, had a low shot from 20-yards held.
A third and final substitution followed five minutes from time, with Luke Charman coming on for Done.
But Dale were dealt a sucker-punch sixty seconds later when the Stags broke the deadlock to win it late on - substitute Jordan Bowery firing into the roof of the net from six-yards.
It was a cruel end to a game for Dale, with the side’s performance worthy of at least a point.