United took an early lead through Mateusz Klich's second attempt at a penalty after a retake but Leeds conceded two goals from set pieces via headers from Tomas Soucek and Angelo Ogbonna as the Hammers moved up to fifth.
Graham Smyth, the YEP's chief football writer, hands out the scores.
1. Illan Meslier
6 - Suspect positioning for the first goal but made a couple of big saves in the second half that kept Leeds in it to the end. Photo by Gareth Copley/Getty Images.
2. Stuart Dallas
7 - His move to the left-back position kept Bowen much quieter than he had been in the first half. Defended well, got forward although not to the effect he was after. Photo by Oli Scarff - Pool/Getty Images.
3. Luke Ayling
7 - His mobility drove Leeds forward, got on the ball lots and like Cooper defended well, largely. Photo by GARETH COPLEY/POOL/AFP via Getty Images
4. Liam Cooper
6 - Beaten in the air for the winner, missed a couple of tackles but defended well against a physical striker for the majority. Created the chance that brought Leeds' penalty. Photo by Gareth Copley/Getty Images.
5. Gjanni Alioski
5 - Struggled to contain flying machine Jarrod Bowen. Got forward but the left flank was problematic in general for Leeds. Took a silly yellow card. Photo by JASON CAIRNDUFF/POOL/AFP via Getty Images.
6. Kalvin Phillips
6 - A steady performance in a game that saw him come up against a dangerous looking Benrahma. They had a good battle that swung both ways. Photo by Gareth Copley/Getty Images.