The visitors took a shock lead through Brandon Hanlan, but Kevin de Bruyne levelled seven minutes later.
Mahrez claimed his double either side of half-time, with Phil Foden and Ferran Torres also beating veteran goalkeeper David Stockdale.
Substitute Cole Palmer, 19, added the sixth with his first goal for the club.
He ran from the halfway line before curling in a fine left-footed shot from 20 yards.
It was a successful night all round for City’s youngsters, with Pep Guardiola handing senior debuts to academy graduates Conrad Egan-Riley, Luke Mbete, Finley Burns, Josh Wilson-Esbrand and Romeo Lavia.
Defender Wilson-Esbrand was particularly impressive, with his excellent control and cut-back assisting Mahrez for City’s second strike.
Victory means Guardiola’s side are unbeaten in the competition since October 2016 and have reached the last 16 for the fifth successive season.
Manchester City manager Pep Guardiola, said, ‘I am just going to say thank you very much to all the Academy. They have many good players, not just one or two. We can count on them absolutely. With their skills and desire, they have got it at this club. I am so proud to be manager of this club.’