Josh Payne's 47th-minute strike put the hosts on course for victory at the Keepmoat Stadium on Tuesday night but League Two outfit Stanley drew level in the 83rd minute when substitute Chris Turner fired home.
Former Liverpool trainee Lindfield struck in the 93rd minute to put the visitors ahead and a brave defensive effort ensured they emerged victorious.
Doncaster almost led inside the second minute when striker Steve Brooker's acrobatic effort flew narrowly over the crossbar.
Fellow frontman Dean Shiels then collected possession and hit a vicious effort which drew a smart save from Stanley goalkeeper Alex Cisak.
Brooker then headed wide from close range as Rovers struggled to make their dominance pay.
Doncaster led within two minutes of the restart when Payne collected a pass from Waide Fairhurst and drilled home from the edge of the box.
Fairhurst then went close to adding a second with a shot from distance but Turner grabbed an equaliser out of nothing in the 83rd minute when he drilled a right-foot shot into the bottom corner from 12 yards.
And Lindfield drilled home a close-range shot to seal a famous win in the 93rd minute.