Sam Allardyce's side took the lead in the 17th minute of the match, with Rodrigo on the scoresheet courtesy of an excellent volley, but Declan Rice levelled the scores on potentially his final home appearance for the Hammers.
Jarrod Bowen then registered in the 72nd minute of the contest before Manuel Lanzini added a third in the final exchanges, and the result has moved West Ham above Bournemouth and into 14th position, now boasting 40 points from 37 matches.
Leeds, though, stay inside the relegation zone, sitting 18th, two points behind 17th-placed Everton, and they would drop to 19th if Leicester City avoid defeat against Newcastle United on Monday night.
Allardyce's side will host Tottenham Hotspur in their final game of the season next Sunday, while West Ham will travel to Leicester before switching their attention to the final of the Europa Conference League against Fiorentina, with the match taking place on June 7.
There were early warning signs for West Ham, with Rodrigo failing to make the most of a mistake from Rice in the fourth minute of the match, before Jack Harrison brought a smart save from Hammers goalkeeper Lukasz Fabianski in the ninth minute, with Leeds carrying the bigger threat in the early exchanges.
As a result, it was not too much of a surprise when the visitors took the lead, with Rodrigo making the breakthrough in the 17th minute of the contest.
Weston McKennie's long throw into the West Ham box was not dealt with by the home side, and Rodrigo found the back of the net with an excellent volley to silence the London Stadium.
West Ham's response was strong, though, and they were level in the 31st minute of the match through Rice, who turned a Bowen cross into the back of the net at the far post, with the ball bouncing into the ground and past Joel Robles between the away side's sticks.
Leeds had to replace Patrick Bamford with an apparent hamstring issue in the 34th minute of the match, which led to Wilfried Gnonto entering the field for the visitors, who continued to come under pressure.
West Ham came close to taking the lead when Pablo Fornals raced towards the edge of the away side's box before unleashing a strike, but his effort was always swinging wide of the post.
Robles then made a smart save to deny Fornals, before Harrison missed the target down the other end after smart work from Rodrigo, with the two teams heading into the half-time break at 1-1.
Robles made a smart save to keep out an effort from Lucas Paqueta early in the second period, before the Leeds goalkeeper made an even better stop to deny Tomas Soucek from a header on the hour mark.
West Ham managed to take the lead in the 72nd minute of the match, though, with Bowen expertly finding the bottom corner after Danny Ings had picked out his teammate.
There was a lengthy VAR check for a possible offside, but the goal was eventually awarded, sparking further celebrations inside the ground and increasing the frustration in the away end at the London Stadium.
West Ham had a golden chance to score a third when a fast break ended with Rice sliding a pass into Fornals, but the Spaniard's goal-bound effort was blocked by Luke Ayling.
Leeds had a brilliant opportunity to level in the 85th minute when Crysencio Summerville worked his way into the home side's box before striking towards goal, but Emerson Palmieri made an excellent block, and West Ham then added a third in stoppage time through Lanzini, who converted a cross from Paqueta, to secure all the points for the home side.