The Bees had totally dominated their more illustrious neighbours, but it looked as though goalkeeper Marcus Bettinelli’s heroics and Hugo Rodallega’s eye for goal would leave them empty-handed.
However, Harlee Dean, who was at fault for Rodallega’s 57th-minute opener, made amends in style with the equaliser nine minutes from time and substitute Jota, the summer signing from Celta Vigo, raised the roof at Griffin Park with his deflected strike at the death.
Victory lifted the Bees, the surprise package in the Championship this term following last season’s promotion, to within a point of leaders Derby following a fourth straight win.
But three points appeared unlikely after a frustrating first hour, during which Bettinelli kept them at bay and Rodallega snatched an undeserved lead for Fulham.
Bettinelli had pulled out of England Under-21 duty earlier this week due to a thumb injury but if he was still feeling any discomfort it did not show.
He palmed an early Tony Craig header over the crossbar and then tipped Jon Toral’s effort around the post.
There was even better to come from the 22-year-old keeper on the half hour when Brentford broke from a Fulham corner, Andre Gray squared the ball and Toumani Diagouraga picked his spot from 15 yards.
The midfielder’s shot looked destined for the top corner but Bettinelli made a superb reaction save to claw the ball out.
As the first half drew to a close, Alan Judge curled a free-kick over the Fulham wall but Bettinelli was equal to it once more.
By contrast, Bees goalkeeper David Button had little to occupy him until first-half stoppage time, when he made a fine stop to keep out Rodallega’s header from Fulham’s first effort on target.
That was a warning Brentford failed to heed and they fell behind to Rodallega’s seventh goal of the season after the break.
Dean gave the ball away to Georeg Williams deep in his own half, Ross McCormack raced into the area and squared the ball to Rodallega for a simple finish past the exposed Button.
However, Dean, clearly keen to make up for his error, charged into the opposition half nine minutes from time and fed Stuart Dallas, before continuing his run into the area and crashing the return ball into the top corner.
A point was the least Brentford deserved but they snatched all three in the 91st minute when Jota cut in from the right and saw his left-foot shot take a deflection off Dan Burn to beat Bettinelli and wrap up a memorable win.