Chelsea left it late to give Graham Potter his first win in his second match since arriving from Brighton to replace the sacked Thomas Tuchel.
Chelsea, who drew 1-1 with RB Salzburg in the Champions League in Potter’s first game, suffered a nightmare start on seven minutes as Wesley Fofana squandered possession and Jordan Ayew fed Odsonne Edouard to fire into the top corner.
Chelsea defender, Thiago Silva, escaped a red card when he was only booked for stopping Ayew’s attack by deliberately handling.
Silva made the most of that escape as he provided the assist for Pierre-Emerick Aubameyang’s 38th-minute equaliser.
The Brazilian headed the ball towards Aubameyang and he let it bounce across his body before swivelling to fire a half-volley into the bottom corner from just inside the area.
It was Aubameyang’s first Chelsea goal since signing from Barcelona on transfer deadline day.
Conor Gallagher, who spent last season on loan at Palace, won it for Chelsea in stoppage-time when the substitute curled a fine finish into the top corner.