The Argentinian swept home from close range in the first half at a rain-hit Selhurst Park to give the Hammers just their second win of the Premier League season and take some of the heat off boss Slaven Bilic.
Palace could and should have got at least a share of the spoils but Christian Benteke missed a first-half penalty and also hit the post, while Alan Pardew’s men failed to take advantage of having an extra man when Aaron Cresswell was sent off with 15 minutes remaining.
The win moves West Ham up to 15th on seven points, while Palace stay eighth on 11 points.
West Ham had the first half-chance in the fourth minute when Pedro Obiang sent Cresswell clear down the left of the area, but the full-back’s rising strike hit the side-netting.
Two minutes later Cresswell did well to tee up Simone Zaza just inside the area but his turn and shot lacked sufficient power to trouble Steve Mandanda.
Palace’s first attempt of note came in the ninth minute when Wilfried Zaha found himself in space down the right of the area, but he dragged his effort well wide of the far post.
West Ham continued to look the more likely to score so it was no surprise when they took the lead in the 19th minute.
Cresswell got away down the left and his cross fell to Lanzini in the centre, and he diverted the ball into the far corner with a first-time effort.
Both sides enjoyed plenty of the ball after the Hammers went in front but it was the visitors who went close to adding a second on 38 minutes when Dimitri Payet’s corner came off Jamie Ward, who was under pressure from Zaza at the time, and bounced just over the goal.
Lanzini then let fly from 25 yards with a right-foot strike which Mandanda got down well to gather on 44 minutes.
Palace were given a great chance to level right on half time when Jason Puncheon was fouled in the area by Angelo Ogbonna.
However, Benteke’s subsequent penalty was a shocker as it drifted well wide of the post.
He almost made amends moments later but his header from a right-wing cross hit the outside of the post.
West Ham had the first chance after the interval when Lanzini chipped the ball over the top for Payet to run on to in the area, but he ran out of space and Mandanda saved at his feet.
On 55 minutes Payet picked up the ball down the left of the area following a surging run from Lanzini, but Mandanda saved well and Palace’s defence scrambled the loose ball away to safety.
Palace came back into the contest but it was West Ham who went close to adding a second on 74 minutes, as Michail Antonio got his head to Lanzini’s corner from the right but his header was cleared off the line.
A minute later Cresswell was sent off for a second bookable offence when pulling back Zaha down the Palace right, just seconds after being yellow carded for diving under a challenge from Yohan Cabaye in the hosts’ penalty area.
On 81 minutes Benteke rose highest in the middle to meet Puncheon’s right-wing corner, but couldn’t keep his header from going over Adrian’s goal.
Palace threw everything at the Hammers in the final moments and Adrian produced a brilliant save to tip Connor Wickham’s close-range header from Andros Townsend’s cross over the bar in stoppage time.