Bryan Mbeumo slotted in a stoppage-time penalty to make it 2-1, minutes after captain Pontus Jansson had equalised with a header at the back post.
Watford led for an hour thanks to Emmanuel Dennis’ first-half header but a late surge from Brentford was eventually rewarded.
Defeat means Watford remain just three points above the relegation zone.
Dennis, who has been directly involved in nine of Watford’s last 12 Premier League goals, was left unmarked as he nodded in the opener against the run of play in the first half.
Brentford had controlled the first 20 minutes, coming close through Shandon Baptiste and Mbeumo but Watford goalkeeper Daniel Bachmann made several smart saves.
Joshua King’s curling effort then struck the post, giving Watford their first corner of the match, and Dennis converted.
Watford looked set to take all three points home too but Brentford burst into life late on when Jansson got on the end of a curling cross to nod in the equaliser.
Brentford piled on the pressure as the game went deep into stoppage time and substitute Saman Ghoddos was brought down by William Ekong to set-up a dramatic finale.
Mbeumo kept his cool to send goalkeeper Bachmann the wrong way and the win, which sparked jubilant scenes at the Brentford community Stadium, moves the Bees up to ninth in the table for at least a night.
Watford toying with bottom three
With just six points separating 14th and 20th in the table, there could be a scrap to avoid relegation this season.
The bottom three is currently occupied by Norwich, Newcastle and Burnley – but Sean Dyche’s side have two games in hand and will go above 17th-placed Watford if they win both.
In the 83rd minute, Watford were set to go six points clear of the drop until Jansson’s equaliser dealt a blow.
It was Jansson’s first Premier League goal and he celebrated heavily, calling on his team-mates and the crowd to lift their game for the final few minutes.
Brentford responded to his rally and pinned Watford in before Mbeumo showed composure to net the winner from the spot.
Watford have attacking threat in Dennis – who has been directly involved in 12 Premier League goals this season – but his last three have all come in defeats to Chelsea, Leicester and now Brentford.