The home side grabbed the early initiative with converted tries by Richard Lepori and Mitch Cox.
But Aaron Ollett-Hobson reduced the deficit just before the break before the Dons scored three unanswered second half tries to claim a third straight win.
Scores from Ollett-Hobson, Loui McConnell and Robbie Storey completed Doncaster’s comeback victory, while Watson Boas kicked four conversions and a penalty.
Stockport County striker sends cheeky message to Doncaster Rovers boss Gary McSheffrey ahead of clash
The Doncaster Rovers team expected to take on Stockport County
Doncaster Rovers player ratings as they leave it late to beat Stockport County
Doncaster Rovers to hold minute's applause for Lakeside drowning victim Jay Walker against Stockport County
The story of how Doncaster Rovers left it late to beat ten-man Stockport County
Doncaster remain fifth in the Betfred League One table but they are now just two points behind second-placed Swinton with eight games of the regular season still to play.
Leaders Keighley Cougars, who beat West Wales Raiders 86-0 to make it 12 wins from 12, are six points clear at the top and look nailed on to secure the one automatic promotion spot.
Doncaster lost four of their first nine fixtures but have now won three on the spin against play-off hopefuls Hunslet, North Wales Crusaders and Swinton.
Richard Horne’s side travel to struggling Cornwall RLFC on Saturday.