New Crystal Palace manager Tony Pulis earned his first win, thanks to Marouane Chamakh’s goal at Selhurst Park on Tuesday.
The Eagles edged Sam Allardyce’s West Ham by a lone goal but a still three points behind fourth from bottom Cardiff.
After the Hammers had early control with Mohammed Diame heading over, Moroccan, Chamakh, headed in his first goal since August from Barry Bannan’s cross.
Palace could have extended their lead as Jussi Jaaskelainen made two saves to deny Jason Puncheon and Cameron Jerome.
Pulis’s side defended stoutly and the three points helped them move off the bottom of the Premier League table.
The manager says there is a “long way to go” but praises his side’s “unbelievable” effort in the victory which is their second in three games.