James Coppinger's 95th-minute winner settled the promotion shoot-out in a game almost totally dominated by Brentford, who settle for third spot and a place in the play-offs.
The Bees had their chances to seal automatic promotion in the dying seconds after Clayton Donaldson was bundled over in the box.
But on-loan Fulham striker Marcello Trotta insisted on taking the subsequent penalty and blasted the ball against the crossbar.
Doncaster striker Billy Paynter then raced away on the break and squared for Coppinger to slide home at the far post with Brentford's strikers lying devastated in the visitors' box.
The game might have had a different complexion early on had Bradley Wright-Phillips volley not crashed against the upright.
Doncaster rode their luck, with defender Rob Jones taking out Donaldson when the striker was through on goal only for Barclays Premier League referee Michael Oliver to wave play on.
David Cotterill did get a sight of goal before the break, forcing Brentford goalkeeper Simon Moore into two smart saves with dipping drives.
Bees skipper Jonathan Douglas could have settled his side's nerves just after the hour, but squandered a gilt-edged chance, firng the ball over the crossbar from close range.
Brentford tried repeatedly to work their way through an uncompromising and physical Doncaster defence, but it was ultimately heartache for Uwe Rosler's side, who now take their chances in the play-offs.