Uwe Rosler's side were pegged back twice, with a 95th-minute equaliser sending the game to extra time, before Miles Storey missed the decisive penalty for the Robins
The visitors nearly took the lead within 30 seconds when Adam Rooney's header back across goal had to be tipped behind by Simon Moore in the Bees goal.
In a frantic start to proceedings, Brentford winger Harry Forrester then carved out space just a minute later to slide a fine pass into Clayton Donaldson's path, but the striker was denied by opposition keeper Wes Foderingham.
And the Bees soon started taking control of the game and nearly took the lead when Donaldson managed to dart in front of Foderingham, but his reaction shot curled wide of the target.
But, within a matter of minutes, Brentford took the lead as Toumani Diagouraga's fast-paced delivery from a corner evaded Marcello Trotta's acrobatic effort only to rebound off Rooney and into his own net to hand the Bees the lead on the day and on aggregate.
Brentford's tails were up, and Trotta twice went close to extending their lead inside the following five minutes, first forcing Foderingham in to a low save down to his right-hand side before shrugging off the challenge of Joe Devera to fire a low shot against the base of the post.
Swindon were finally afforded a chance on the ball five minutes before the break when Andy Williams swivelled on the ball before sending a rising shot over.
And the Robins were made to rue that miss as Brentford extended their lead immediately afterwards when Trotta fed Donaldson 20 yards from goal to hit a first-time effort that appeared to surprise Foderingham.
However, with the game approaching half-time, Swindon snatched a lifetime as Rooney made up from his earlier mistake by evading the attentions of five Brentford defenders to score from seven yards after fine build-up play from Gary Roberts.
The end-to-end nature of the game took just 75 seconds to resume in the second half, as Roberts' poor pass across midfield was pounced on by Donaldson near the half-way line and the striker rushed forward and finished with a deft chip to restore his side's two-goal lead.
But, in another twist, Swindon pulled another goal back just 10 minutes later when full-back Joe Devera found himself in the right place at the right time to convert Aden Flint's rebounded header.
As the game entered the final stages, the visitors saw two penalty appeals turned down in as many minutes, but both were quickly, and correctly, waved away by the referee before seeing an effort cleared off the line as the game entered stoppage time.
Swindon, though, still had time to snatch an injury-time equaliser as Aden Flint headed home a last-gasp corner to force extra time.
The visitors, though, were handed a blow midway through the first half of extra time, as former Brentford loanee Nathan Byrne picked up a second yellow card for handball, earning him his marching orders.
But that was to be the only moment of note in a tense, cagey additional 30 minutes as both teams prepared for the lottery of a penalty shootout.
With both teams scoring their opening three penalties, 19-year-old Miles Storey was the first, and only, player to miss from the spot as Brentford went on to bury their remaining spot kicks and seal a place in the League One play-off final where they will face Yeovil.