Bean stooped low in the box 10 yards out to power Charlie MacDonald's cross into the bottom corner and send the home supporters wild.
It was no more than the League One outfit deserved for outplaying the Tigers for long spells of a thrilling cup tie.
But it did not start well for the Bees, striker Robbie Simpson heading back across his own goal for the waiting Mark Cullen to slam home for the visitors.
But midway through the half Brentford responded, this time Simpson curling a beauty over the wall into the top corner from the edge of the box.
Nigel Pearson's side started the brighter after the break when Robert Koren saw his chipped effort from 20 yards bounce back off the angle.
Minutes later Jamie Devitt sent an angled drive just wide before Brentford began the fightback.
It was all the Londoners for the final half-hour and only a superb goal-line stop from City keeper Matt Duke denied Simpson's near-post header.
Brentford also hit the woodwork when winger Myles Weston saw his cross skim the top of the bar before Bean's thrilling finale.