Rovers had not won in five games but three hard-earned points at the Greenhous Meadow lifted them into pole position on Tuesday night.
Despite having Dave McAllister sent off late in the first half, the hosts stood firm until the 73rd minute when James Husband broke the deadlock.
Shrewsbury thought they had snatched an unlikely point when goalkeeper Gary Woods somehow allowed a last-minute effort from Tom Eaves to squirm past him.
But Doncaster were not to be denied and Kyle Bennett, on as a substitute, grabbed all three points when his deflected shot with time almost up found its way in.
"I'm pleased to be back to winning ways," said manager Flynn. "I felt on Saturday we were back on track in terms of performances and that was proved here as our performance level was very good.
"Obviously when you play against 10 men and a team so well organised as Shrewsbury were, it made it hard for us.
"A point away from home at this stage of the season is always good but in the circumstances it wouldn't have been seen as that so it was nice to come away with a win and our good away form continues.
"We've gone top of the league. It's the first time this season and let's enjoy being up there. One person will be happy and that's the chairman because that's what he's stated all along - 'let's get top'."