Everton joined them in defeat, thrashed 4-1 at Premier League rivals Bournemouth who ended a run of four successive losses.
Gillingham, 77 places below Brentford in the league hierarchy going into the game, grabbed a 75th minute equaliser in West London when substitute Mikael Mandron headed in to cancel out England prospect Ivan Toney's third minute goal.
The Kent side then went through to the fourth round for the first time in 26 years when Mikkel Damsgaard hit the bar in sudden death.
The match at the Community Stadium kicked off late after Gillingham were delayed on their journey.
Bournemouth's home game against Everton was the only top flight clash of the night, featuring two clubs just above the relegation zone and Bournemouth caretaker manager Gary O'Neil seemingly on borrowed time.
Both fielded much-changed lineups after stinging defeats last weekend.
Everton, who play at Bournemouth again in the league on Saturday, squandered several chances and were booed off by the travelling fans at the interval.
Poor defending allowed Junior Stanislas to make it 2-0 with a 47th minute tap-in and Everton manager Frank Lampard made a triple substitution on 51 minutes after starting with 11 changes to last Saturday's 2-0 league defeat to Leicester City.
Demarai Gray pulled one back in the 67th but Bournemouth settled their fans' nerves with Emiliano Marcondes restoring the two goal advantage on 78 minutes and Jaidon Anthony making it 4-1 in the 82nd.
Leicester saw off League Two (fourth tier) Newport County 3-0 to reach the last 16, with former England striker Jamie Vardy scoring twice (70, 82) after James Justin opened the scoring just before the break.
Third tier Lincoln City provided an upset when they won 3-1 at Championship opponents Bristol City.
Championship leaders Burnley beat League Two Crawley Town 3-1 while League One Charlton Athletic beat League Two Stevenage 5-4 on penalties in a match that ended 1-1.
MK Dons won 2-0 at home to fellow League One rivals Morecambe.
Fourth round matches will be played in the week starting Dec. 19, after the World Cup in Qatar