You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Newport, 82 rungs below City on the English football ladder, rattled Pep Guardiola's aristocrats in the first half and Tyreeq Bakinson almost gave them a dream lead.
But City's class showed in the second half and once Leroy Sane's powerful shot from a tight angle put them in front after 51 minutes the chances of a seismic Cup shock faded away.
Foden's 75th-minute shot crept in at the near post to subdue the home fans but when Padraig Amond replied in the 88th minute a grandstand finish looked on the cards.
A second goal for youngster Foden arrived 71 seconds later though before Riyad Mahrez rubbed salt into Newport's wounds with virtually the last kick of the game as City claimed a 12th win in 13 matches in all competitions.
In the day's other fifth-round ties Brighton and Hove Albion shrugged off their poor Premier League form to beat Frank Lampard's Derby County 2-1 thanks to first-half goals by Anthony Knockaert and Juergen Locadia.
Former Chelsea and England left back Ashley Cole grabbed Derby's consolation -- the first FA Cup goal of his career.
Millwall booked their place in the quarter-finals with a 1-0 victory over an AFC Wimbledon side who had outclassed top-flight West Ham United in the previous round.