Neal Maupay fired the Bees in front against the run of play, but there was little doubt over the outcome once Foden levelled in first-half stoppage time.
Kevin De Bruyne and Erling Haaland then teed up the England international to complete his second career hat-trick after the break.
City’s rivals for the title may rue not opening up an advantage while De Bruyne and Haaland were sidelined by injury in recent months as they look primed to become the first side to ever win four consecutive English top-flight titles.
Guardiola now has a fully fit squad to choose from and had the luxury of leaving the likes of Jeremy Doku, Jack Grealish and John Stones on the bench.
Brentford goalkeeper Mark Flekken started the night as statistically the worst goalkeeper in the Premier League for a percentage of shots saved.
However, the Dutchman was in inspired form to frustrate the champions in the opening 45 minutes.
Flekken was tested a full stretch by two efforts from outside the box by Julian Alvarez before he parried a piledriver from Kyle Walker.
Brentford had barely posed any threat before they went in front on 21 minutes as City’s run of just one Premier League clean sheet since October goes on.
Flekken got the assist on top of his heroics at the back as from his goal-kick, Ivan Toney blocked off Nathan Ake, allowing Maupay to run clear and score for the fifth consecutive game.
Haaland had a huge chance to mark his first start for two months with a goal moments later, but could not beat Flekken when sent clean through on goal.
The shots continued to rain in on Flekken as Josko Gvardiol and De Bruyne were next to test him.
In total City had 17 efforts on goal with 10 on target in the first half and finally made their final one count.
Ethan Pinnock headed De Bruyne’s cross straight into the path of Foden, who controlled the ball on his chest and swept the ball low into the corner.
Eight minutes into the second period a De Bruyne delivery this time picked out the head of Foden directly to head past Flekken.
Brentford rallied and had their chances to get back on level terms as Ruben Dias produced a vital block to turn Christian Norgaard’s shot behind.
But City made sure of an 11th victory in their last 12 games 20 minutes from time.
Haaland may not have got his goal, but the Norwegian played his part with a perfectly weighted pass for Foden to bear down on goal and slot coolly past Flekken.
Arsenal’s 3-1 victory over Liverpool on Sunday kept the Gunners in the race for their first league title in 20 years.
But that result also played into City’s hands and they remain the team to beat as the business end of the season approaches.