Three goals in four extra-time minutes saw Bradford City lose their first cup tie of the season – at the 11th time of asking.
But Phil Parkinson’s side can take plenty of positives from the defeat after making nine changes to the side that had played at Southend four days earlier.
Brentford were the brighter side in the opening stages with City goalkeeper Jon McLaughlin saving well from Stuart Dallas and Marcello Trotta.
Paul Hayes fired wide before Bradford took the lead against the run of play 11 minutes before the break.
The chance appeared to have disappeared when Zavon Hines hesitated and his shot was blocked, but the ball rebounded to Kyel Reid, in his first start since October, and he finished coolly with his left foot from the right-hand side of the area.
McLaughlin did well again, denying Hayes, but was eventually beaten from the penalty spot, Marcello sending him the wrong way after he had been nudged to the floor by Carl McHugh.
After a quiet opening to the second half Brentford almost broke the deadlock with 13 minutes remaining, but McLaughlin got a fingertip to Shaleum Logan’s shot.
City finished normal time the stronger and Rory McArdle’s header from Scott Brown’s corner was deflected away and Ricky Ravenhill flashed an effort narrowly wide.
Alan Connell put City back in front from the spot four minutes into extra time after Blair Turgott had been fouled, but two goals in two minutes from Trotta and Donaldson put the home side ahead.
Harry Forrester completed the home side’s victory a minute into the second extra half.
Brentford: Gounet; Logan, Craig, Legge, Bidwell; Dallas (Donaldson 78), Adeyemi (Diagoura 63), Douglas, Saunders (Forrester 71); Trotta, Hayes. Unused substitutes: Lee, Barron, Dean, Oyeleke.
Bradford City: McLaughlin; R Jones, Bass (Curtis 105), McArdle, McHugh; Brown, Ravenhill, Reid (Thompson 56), Turgott; Connell, Hines (Baker 67). Unused substitutes: Darby, Hepworth, Erangey, Duke
Referee: G Scott.