The Welsh side proved obdurate opponents all afternoon and Ederson had to make some key first half saves before second half goals from Leroy Sane and Phil Foden looked to have secured victory.
To their credit, Newport halved the deficit a minute from time before Foden struck again and then Mahrez rounded off the win with a fine late effort.
But though the Blues are still pressing for glory on four fronts, Mahrez insisted the squad would continue to operate on a game by game basis and not get distracted by looking too far ahead.
“The result is the most important thing in these types of games - if you can add a good performance then it’s perfect,” said the Algerian.
READ: When is the FA Cup sixth round draw?
WATCH: Inside City Episode 329
“We played good and controlled the game. We are professionals and have to adapt to anything.
“Everyone is very happy to be through to the quarter-finals.
“They didn’t have a lot of chances - we controlled the game and we are happy to go through to the quarter-finals.
“We have to forget the FA Cup now and focus on the Champions League.
“We are taking it game by game, it is not good to project yourself too far forward.”