Paddy Madden scored his 14th league goal of the season and Ed Upson hit a spectacular second as Yeovil won their fifth successive league game.
Madden put the Glovers ahead against the run of play when Tony Craig's clearance hit Kevin Dawson and fell straight to Madden, who slotted home.
Upson scored a superb 25-yard second before Dan Burn volleyed a late third.
Clayton Donaldson and Tom Adeyemi had good chances for the Bees, who have now won one of their last six league games.
VIEW FROM THE DRESSING ROOM
Yeovil Town manager Gary Johnson tells BBC Somerset:
"They are above us in the table and we needed to pull them back towards us a little bit.
"I thought the nature of the win was fantastic. This team seems to be getting better.
Johnson on goalkeeper and father-to-be Marek Stech:
"He made two fantastic saves but goalkeepers have to do that - that's their job.
"The only disappointment for him today is that he said he'd name his kid after the first goalscorer.
"Now he's got to call it Paddy Stech which I'm not sure has a ring to it."
Brentford boss Uwe Rosler told BBC London 94.9:
"I think we were by far the better team after 35 minutes, but they punished us straight away after one mistake.
"In the last month we have had three or four goals against us from long shots and like the second today it's very hard to defend."