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.
The defeat was a little harsh on Doncaster, who held their own for large parts.
4 / 4