Bees forward Clayton Donaldson's brace either side of Harry Forrester's strike clinched the points in an emotion-charged end-to-end clash.
Dons pair Ryan Lowe and Stephen Gleeson twice put the visitors ahead with goals in either half, but the Bees had the final say.
Lowe broke the deadlock after 14 minutes when he coolly side-footed home from the edge of the area from a slide-rule through-ball from Gleeson.
But Forrester capitalised on a moment of hesitation in the Dons' box just before the break, weaving past three defenders and squaring for Donaldson to tuck home from close range.
The hosts were behind again minutes after the interval, Gleeson turning sharply and sliding a superb shot inside the far post.
It was level again after 77 minutes when Dons goalkeeper David Martin could only parry on-loan Marcello Trotta's drive into the path of Forrester, who smashed home the rebound.
The Bees winger, unplayable for long spells, had a chance to wrap it up, but Martin got the better of him in a one-on-one.
But the Londoners made sure of the points with a minute to go when Trotta's fierce drive was palmed clear to the on-rushing Donaldson, who bundled home to the delight of the home fans.