Jeffrey Schlupp scores in Crystal Palace defeat
Second-half goals from Robert Snodgrass, Javier Hernandez and Anderson gave the Hammers their third consecutive Premier League win and took them into the top half of the Premier League table.
James McArthur's early goal had put Palace in command, with the midfielder prodding the ball past home goalkeeper Lukasz Fabianski after reacting first to a James Tomkins knockdown.
But the hosts were a different proposition after the break. Snodgrass curled in an equaliser from 20 yards and Hernandez then put them ahead after Wayne Hennessey could only parry Anderson's free-kick.
The Hammers' top scorer then added a superb third, finding the top right corner from 20 yards - his sixth goal of the season.
While Palace rallied, with Jeffrey Schlupp's header reducing their arrears, they could not find an equaliser, and fall to 16th in the table.