Goals from Keith Treacy and Miguel Llera clinched the points for the Owls, who rode their luck and were outplayed for long spells.
Treacy gave the visitors the lead just before the break, catching goalkeeper Simon Moore cold with a quickly-taken free-kick at the near post.
Bees skipper Jonathan Douglas should have put the hosts ahead moment earlier, but smashed his first-time shot against the crossbar from close range.
Clayton Donaldson equalised on the hour mark from the penalty spot after Mark Beevers had brought him down in the box, the defender escaping without a card.
A host of missed chances and two brilliant saves from Owls goalkeeper Stephen Bywater kept Brentford at bay as the home side pushed for the winner, but former Brentford defender Llera settled it in the 66th minute, glancing home a header from a near post corner.