Kevin De Bruyne's free-kick rattled the crossbar as City dominated the early stages.
But Palace took the lead on 39 minutes, Gary Cahill heading across goal for Cenk Tosun to nod in his first Palace goal since joining from Everton.
City won a second-half penalty for a handball by Jairo Riedewald, but it was overturned after consultation with the VAR.
Sergio Aguero made it 1-1 with eight minutes remaining, finishing from substitute Gabriel Jesus's cross.
The Argentinian then headed in from Benjamin Mendy's cross to give City an 87th-minute lead.
But Wilfried Zaha surged down the left in the last minute and delivered a cross which Fernandinho diverted into his own net.
City stay second with 48 points, 13 behind Liverpool, while Palace are ninth on 30 points.
Man City: 21 Jan v Sheff Utd (A)
Crystal Palace: 21 Jan v Southampton (H)