Morata gave Chelsea the lead by finishing well after good work from Pedro, but Palace levelled when a one-two with James McArthur caught David Luiz out of position and Andros Townsend beat Kepa Arrizabalaga with a fine drive.
The improving Morata, though, scored his fourth goal in as many Premier League appearances, converting a free-kick from substitute Eden Hazard to set the Blues up a fourth consecutive win in all competitions.
And when Pedro turned in a cross from another Spaniard, flying left-back Marcos Alonso, Chelsea were able to celebrate moving up to second place in the table.
Chelsea struggled to break Palace down for much of a frustrating opening half, but they nudged ahead with their first shot on target in the 32nd minute.
Pedro's initial cross was blocked but he seized on the loose ball to fire in a low centre that Morata controlled well before drilling an excellent volley past Wayne Hennessey.
Chelsea quickly had the ball in the net again only for an offside flag to curtail Willian's celebrations.
But Palace levelled in the 53rd minute, McArthur sending Townsend clear of David Luiz to rifle a superb strike across Kepa and into the bottom-left corner.
Hennessey made an excellent save to keep out a David Luiz header but the goalkeeper was beaten in the 65th minute, Hazard making a rapid impact from the bench.
The Belgium star's wicked free-kick from wide on the right deceived the Palace defence and Morata thump in a low drive from the back post.
The points were secured for Maurizio Sarri's side when Alonso delivered the perfect cross for Pedro to slam home, but Morata wasted a great chance to seal his hat-trick in stoppage time with a failed chip claimed by Hennessey.
Blues keep pace with City
Manchester City sent a warning sign to their title rivals with a 6-1 demolition of Southampton earlier in the day, but Chelsea are right on their tails just two points back. Morata is finding form again and with Hazard fit after a spell on the sidelines with a back injury they are serious contenders.
Morata emerges as leading light
With Olivier Giroud watching from the stands due to a muscular issue and Hazard only fit enough for the bench, Morata was under pressure to deliver. The striker lost confidence badly last season but is getting back to his best, with a pair of fine finishes taking him to six goals in all competitions.