Ivan Toney scored his 20th goal of the season, and Tarique Fosu made all three goals, as Brentford climbed up to second in the Championship table.
The Bees had fallen behind in only the third minute when Zak Vyner netted.
But Sergi Canos equalised midway through the first half and Toney put Brentford ahead early in the second. Saman Ghoddos hit the third, before Nakhi Wells scored a late consolation.
After a mixed first half, Brentford were excellent and played some lovely football in the second – with Canos, Ghoddos and Fosu all outstanding – as they extended their impressive unbeaten Championship run to 19 matches.
They came into the game on a high, following Saturday’s 7-2 win over Wycombe, but were quickly deflated when they fell behind early on.
City won a dubious free-kick on the left, which was floated in by Jack Hunt and allowed to reach the far post, where Vyner prodded it home.
The goal shook up the Bees, who were a bit disjointed for a while. They soon found their rhythm and after former Brentford goalkeeper Daniel Bentley had superbly blocked a fierce Ghoddos shot, they equalised.
Fosu took advantage of a slip by another former Bee – Alfie Mawson – to escape down the right and put in a cross which Bentley, under pressure from Toney, could only palm straight to Canos, who slotted home the equaliser.
Fosu also created the second goal when he ran down the right and crossed for Toney to get in front of a defender to sweep home from eight yards.
And Fosu then made the third when he again ran at the City defence before slipping the ball to Ghoddos, whose shot hit the underside of the bar and then fortunately found its way back to him to cleverly hook home from close range.
Wells pulled one back after rounding David Raya late on after Ethan Pinnock gave the ball away and Mathias Jensen inadvertently played it into the area, but it did not prevent Brentford collecting all three points.
Brentford: Raya, Dalsgaard, Henry (Reid 86), Sorensen, Pinnock, Janelt, Jensen, Ghoddos (Zamburek 79), Canos, Fosu (Forss 79), Toney (Roerslev 88).