Brandon Hanlan gave the visitors an early lead, but Kevin de Bruyne equalized seven minutes later.
Mahrez scored both of his goals either side of halftime, with Phil Foden and Ferran Torres both beating David Stockdale, the veteran goalkeeper.
Cole Palmer, a 19-year-old substitute, scored the club’s sixth goal.
Pep Guardiola gave academy graduates Conrad Egan-Riley, Luke Mbete, Finley Burns, Josh Wilson-Esbrand, and Romeo Lavia their senior debuts on a good night for City’s youth.
Wilson-Esbrand stood himself as a standout defender, with his great control and cut-back helping Mahrez for City’s second goal.
Source: BBC Sport