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 an 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.