Improving Rovers, who had won four of their last five matches before Saturday, almost held on for their first away clean sheet of the season at Edgeley Park.
But Stockport's Tanto Olaofe headed home the winning goal in the 83rd minute after he was left unmarked in the six-yard box.
The defeat was a little harsh on Doncaster, who held their own for large parts.
Scroll down for our player ratings.
1. Match action
Tom Nixon drives forward. Photo: Howard Roe/AHPIX LTD
2. Louis Jones - 8
Will no doubt have been devastated to have been beaten after pulling off a string of superb saves to keep Stockport at bay for so long. Photo: Howard Roe/AHPIX LTD
3. Tom Nixon - 7
Defensively sound and good going forward. Another good display. Photo: HOWARD ROE
4. Tom Anderson - 7
Looked comfortable and assured for most of the afternoon. Photo: HOWARD ROE