Palace came into the contest having won once in their last 10 league games but got off to a perfect start with James McArthur breaking the deadlock with six minutes on the clock.
However, the introduction of striker Andy Carroll at halftime revitalised West Ham, who turned the match on its head with goals from Robert Snodgrass -- his first in the league for the club -- and Javier Hernandez.
Close-season signing Felipe Anderson fired a stunning third in the 65th minute -- his fifth goal in his last six league games -- to calm the nerves around the London Stadium.
But the hosts had to hang on for their third successive win -- the first time they have done so since December 2016 -- with Jeffrey Schlupp getting Palace back in it with 14 minutes left.
West Ham climbed to 10th while Palace's woeful run of form leaves them 16th, two points above the relegation zone.
"It is the third game in a row where we score three goals and that reflects what we are trying to do," West Ham manager Manuel Pellegrini said.
"I always say to the players we must have a winning mentality."
Injured Austria striker Marko Arnautovic was missing for West Ham, but it was defence that was their undoing early on, with McArthur stealing in unmarked from a set piece to break the deadlock.
The hosts really struggled to create any openings of note in response, and were fortunate not to fall further behind when Luka Milivojevic thundered an effort against the bar on the stroke of halftime.
That good fortune proved to be a turning point, as West Ham came out for the second period with added impetus, and levelled through a fine Snodgrass goal, before Hernandez pounced to put his side in front in the 62nd minute.
In-form Anderson then found the net three minutes later to put the hosts in control, before Schlupp ensured a nervy finish.
"After they equalised we started to play better and had good control but after the free kick and strike from Anderson we find ourselves 3-1 down," Palace manager Roy Hodgson said.
"We continued to ask questions but the two goals after the equaliser did for us." (Reporting by Peter Hall; Editing by Ken Ferris)
(This story has not been edited by Devdiscourse staff and is auto-generated from a syndicated feed.)