The win bridges the gap between the champions and Liverpool to nine points after the leaders won 2-1 at Crystal Palace earlier in the day.
A lively start to the opening period saw Kevin De Bruyne find space in the Chelsea penalty area and lash a shot just wide of Kepa Arrizabalaga’s right post in the 4th minute.
Five minutes later the visitors went close on the counter when Tammy Abraham played Willian through but the Brazilian sent his effort just wide.
Fikayo Tomori was next in line to have the hosts’ heart in their mouth when he struck a loose ball in the City area narrowly off target.
Chelsea took the lead in the 21st minute when Mateo Kovacic’s pass carved open the City defence with a wonderful pass, allowing N’golo Kante to run in from deep to nick the ball past Ederson.
The visitors’ lead lasted just six minutes before De Bruyne’s deflected effort from a City attack pulled the hosts level.
Riyad Mahrez went on one of his mazy runs at the Chelsea defence in the 36th minute, skipping past two opponents in the process before slotting the ball through Tomori’s legs and past the outstretched hands of Kepa to give City the lead.
Guardiola’s men hit the woodwork two minutes to halftime when Kepa gifted Aguero the ball from a clearance and Chelsea were able to clear.
After the break, Mahrez had another effort tipped over by Kepa in the 65th minute after Fernandinho’s effort from a corner had been blocked.
Willian then tested Ederson from range with a dipping volley that was pushed over in the 79th minute.
Manchester City have now climbed above Chelsea into third place following their return to winning ways.