Calvin Andrew's 81st minute screamer gave Town their first win in 19 games after an uninspiring but ultimately fruitful afternoon's football at Griffin Park.
Neither side really looked like winning it as the match drifted towards its conclusion, but Town seized the initiative with around 15 minutes remaining, and in the end were good value for their win.
Paul Hart's side were sluggish in the opening exchanges of the clash, with the hosts fashioning their first chance as a result of a Town mistake - Paul Caddis' slip allowing Gary Alexander to play in Jeffrey Schlupp - but the striker could only drag his shot wide when one-on-one with Phil Smith.
Town began to gain some composure as the half developed, and might have gone ahead on 22 minutes as Bees 'keeper Simon Moore juggled with an Alan Sheehan cross with Matt Ritchie ready to pounce, but Moore gathered himself just in time to poke it clear of danger.
It was a largely disjointed affair thereafter with neither side looking at their best, but both could have taken the lead before the half hour mark had Gary Alexander and Calvin Andrew been more clinical with respective 20-yard volleys.
The match proceeded to drift listlessly towards the half time whistle, with both Moore and Smith acting as spectators for large periods.
Town started the second half brightly, and might have been in front just four minutes into it, but Matt Ritchie completely miss hit a cross from David Prutton and the ball trickled harmlessly into the path of Pim Balkestein who cleared easily.
Jon-Paul McGovern nearly conjured a stunning goal minutes later as he directed a chip delicately goalwards from 25 yards, but it drifted just over with Moore back pedalling frantically.
Despite Town's early dominance, things evened up around the hour mark, with much of the first half's rigidity and lack of flair returning - wayward 20-yard free-kicks from Craig Woodman and Alan Sheehan the only attempts either side could muster as the match looked like drifting lifelessly towards a stalemate.
However, with 15 minutes left, Town began to take a stranglehold on affairs with both Douglas and substitute Alassane N'Diaye taking control of the midfield battle.
Thus, it came as little surprise when the visitors took the lead after 81 minutes through Calvin Andrew's first goal for the club.
Paul Caddis drifted the ball towards the edge of the box where Andrew showed great strength to take it down and turn, before finding himself in space and smashing the ball into the bottom corner.
The Crystal Palace loanee was inches away from netting a second stunner moments later, but this time his 25-yard drive was denied by the crossbar.
The visitors had to survive a few scares late on as the Bees searched for an equaliser, but they held out for what could yet prove to be a crucial three points in the club's battle to avoid the drop.