The Bees twice came from behind in an end-to-end M4 derby, with goals from Sam Saunders, Clayton Donaldson and Marcello Trotta sealing the points.
Ryan Mason gave the visitors the lead when he fired Nicky Ajose’s flick on into the bottom corner of the net with just 10 minutes gone.
But Saunders, who twice tested Robins goalkeeper Wes Foderingham with low drives, levelled things up as the half-hour approached when he whipped a lovely free-kick over the defensive wall.
Ajose edged Swindon ahead in the 53rd minute when he side-footed Alex Pritchard’s deflected shot past flat-footed home keeper David Button.
But the Bees took just two minutes to react to the setback when Donaldson dived full length to power a header home from Alan McCormack’s drilled right-wing cross.
With the game deadlocked at 2-2 both sides went in search of a winning goal. Trotta tested Foderingham with a dipping drive and Button dived at full stretch to tip the lively Prichard’s bounding effort wide.
The winner came after 71 minutes when Trotta somehow managed to hook home Jonathan Douglas’s through ball under close pressure from three defenders.
Button ensured the points for the Bees with a great save from Pritchard’s late free-kick.