Marcelo Bielsa's Whites fell behind in the 34th minute but in extremely contentious fashion as Lanzini converted from a goalmouth scramble but only after a crucial intervention from Jarrod Bowen who had been in an offside position.
The danger began as Nikola Vlasic turning Whites debutante Leo Hjelde before making his way towards goal but Hjelde produced a fine block, after which Whites 'keeper Illan Meslier looked to gather the loose ball.
But Vlasic and then Bowen both got in the 'keeper's way and made slight touches before Lanzini thumped home a low finish in what was by then a goalmouth scramble.
Bowen had been in an offside position before blocking Meslier's path but Stuart Attwell allowed the goal to stand and VAR also opted against disallowing the strike, despite a lengthy look.
The goal set the Hammers on their way to a 2-0 victory but injured Whites captain Liam Cooper quickly took to social media after the incident to label the decision a "shambles."
talkSPORT posted a clip of the goal and asked 'should West Ham's goal have been disallowed for offside?' to which the official Specsavers Twitter account replied "depends if you're wearing a blindfold or not."
A message from the Editor:
Leeds has a fantastic story to tell - and the Yorkshire Evening Post has been rooted firmly at the heart of telling the stories of our city since 1890.
We believe in ourselves and hope you believe in us too. We need your support to help ensure we can continue to be at the heart of life in Leeds.
Subscribe to our website and enjoy unlimited access to local news and information online and on our app.
With a digital subscription, you can read more than 5 articles, see fewer ads, enjoy faster load times, and get access to exclusive newsletters and content.
Click here to subscribe.
For more details on our newspaper subscription offers click here.
Thank you Laura Collins