The Irons went ahead the 34th minute but in highly controversial fashion as Manuel Lanzini converted from a goalmouth scramble but only after a crucial intervention from Jarrod Bowen who had been in an offside position.
The goal stood despite a lengthy check from VAR and both sides then squandered some fine chances to add to the scoring before the Hammers finally put Leeds away deep in second half stoppage time as Bowen finished off an Irons counter attack.
Whites head coach Marcelo Bielsa was without nine players due to injuries including the still absent Patrick Bamford and the Argentine gave debuts to youngsters Leo Hjelde and Lewis Bate plus a first start to Sam Greenwood.
West Ham's Bowen fired in the game's first attempt in the fifth minute but his low drive from 25 yards out flew a long way wide of the target.
Five minutes later, Leeds failed to properly clear Declan Rice's cross and Bowen would have converted on the follow-up but for Luke Ayling clearing off the line.
More danger followed three minutes later as Michail Antonio seized upon a loose ball on the edge of the box and the striker's vicious whipped effort was deflected just over.
United's first shot at goal arrived in the 19th minute when debutante Bate received the ball in space on the right flank and the midfielder cut inside before sending in a curled attempt that was straight at keeper Alphonse Areola.
Greenwood then blasted an attempt way over the bar from 20 yards out before another Whites debutante Hjelde survived an accidental handball in the box when clearing a Hammers free kick.
But Leeds were giving it a good go and Mateusz Klich saw a fierce drive blocked as the game reached the half hour mark.
Greenwood's clever flick from a Jack Harrison cross was then easily gathered and less than one minute West Ham went ahead as Lanzini thumped home a low finish from a scramble which resulted from Nikola Vlasic turning Hjelde in the area before Hjelde produced a fine block.
Illan Meslier looked to gather the loose ball only for Vlasic and then Bowen to get there first and whilst Bowen looked offside, the goal was allowed to stand despite a long check from VAR.
The Hammers then went close to adding a second as Antonio fired wide on the stretch to a Ben Johnson cross from the left and the Irons squandered one final first-half chance deep in stoppage time as Meslier saved from Ryan Fredericks who failed to connect properly to a Bowen cross from close range.
Key Whites duo Raphinha and Stuart Dallas were brought on during the interval as Bate and Greenwood made way but only a strong save by Meslier denied the Hammers a second seven minutes after the restart as Antonio shrugged off Llorente before setting up Bowen whose fierce low drive was saved by Meslier's feet.
Rice then blazed a wild effort over the bar from the edge of the area, shortly before Leeds made another change as Adam Forshaw replaced Ayling which meant Dallas moving to right back.
United then lost the services of Junior Firpo who had taken a knock on the head after colliding with Meslier at the end of the first half.
Firpo was still struggling and Cody Drameh was brought on in his place in the 69th minute, after which Leeds squandered a glorious chance to equalise three minutes later as Harrison sent a volleyed Klich cross wide from close range.
Back came the Hammers and Rice curled another shot wide before Leeds made another change as Crysencio Summerville replaced Hjelde with 12 minutes left.
The Irons were inches away from adding a second three minutes later as Fredericks cut in before flashing a low effort just the wrong side of the posts.
But Leeds squandered another golden opportunity to level in the 88th minute when a firm low cross from Harrison fell to James only for the ball to fly off the Wales international and wide.
The Whites continued to push on in an attempt to draw level but the Hammers bagged a second in the 93rd minute by cashing on a counter attack from a Leeds corner, Antonio racing away and feeding Bowen who fired home a low finish.
Leeds United: Meslier, Ayling (Forshaw 60), Llorente, Hjelde (Summerville 78), Firpo (Drameh 69), Koch, Bate (Dallas 46), Klich, James, Harrison, Greenwood (Raphinha 46). Subs not used: Klaesson, Moore, McCarron, Jenkins.
West Ham United: Areola, Fredericks, Dawson, Diop, Johnson, Rice, Souček, Vlašić (Masuaku 88), Lanzini (Fornals 76), Bowen, Antonio (Yarmolenko 90). Subs not used: Randolph, Alese, Baptiste, Král, Noble, Okoflex.
Referee: Stuart Attwell.
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