The result sees Pep Guardiola's side move into the top half of the table into eighth place while Burnley remain a point above the relegation zone.
Burnley also lost 5-0 at City last season in the Premier League, in the FA Cup in January, 2019 and in the league in 2018.
City opened the scoring in the first five minutes with Kevin De Bruyne setting up Mahrez inside the area to score.
Mahrez grabbed his second with a brilliant solo goal after he received a throw-in from Kyle Walker and danced past two defenders and finished with a curling shot.
The hosts thought they scored a third moments later but Torres' header was ruled out for offside.
City did make it 3-0 just before the break after De Bruyne contributed another assist and Mendy volleyed in his cross.
Torres grabbed City's fourth after 66 minutes before Mahrez completed his hat trick with a header two minutes later.
"It was important to come back with a victory in the Premier League," Guardiola said after the match. "One more game.
"We play a lot of games, so to play 90 minutes and maintain a good level is not easy but there are always things to improve on."