Tomas Soucek dedicated his side's victory over Luton Town to David Moyes as the West Ham manager signed off at home in winning ways.
West Ham confirmed earlier this week that Moyes is to depart London Stadium at the end of the season when his contract expires.
The Hammers defeated Luton 3-1 in Saturday's Premier League contest, with Moyes given a strong ovation before, during and after the match.
Soucek, who netted either side of goals from James Ward-Prowse and youngster George Earthy, is grateful for what Moyes has done.
"It is tough to take. The manager has been unbelievable and improved this club a lot," he told BBC Sport.
"We wanted to get the win for him and we're happy that we did in the second half. It was tough at the beginning but it's a good win for everyone."
West Ham's comeback victory snapped their latest four-game winless streak in all competitions, which included a 5-0 loss at Chelsea last week.
Moyes, who guided United to Europa Conference League glory last year, was glad to bow out with three points in front of a fanbase that has at times been divided over his future.
"I go away from here with great memories," said Moyes, whose side conclude their campaign at Manchester City next weekend.
"The club is a brilliant club and has so much room for improvement. It can step up again and I hope that they do. The crowds here are huge and we had a great crowd today.
"I have lots of great memories here. We have beaten a lot of the bigger sides at home and the biggest thing is that West Ham are back on the map."
Luton took the lead in East London through Albert Sambi Lokonga inside six minutes, but they were unable to hold on for a much-needed win.
The Hatters have just one win in their past 16 matches and now look all but certain to be relegated after just one season in the top flight.
Nottingham Forest require just one point from games with Chelsea and Burnley to confirm Luton's relegation.
However, the Hatters' vastly inferior goal difference means they effectively cannot catch Forest, even if every remaining result goes in their favour.
Town boss Rob Edwards had tears in his eyes when he applauded the away fans at full-time as he accepted his side's fate after a gruelling campaign.
"I was emotional at the end with the way our supporters reacted," he said. "I can only say thanks to the players, the staff and our fans.
"We haven't got over the line but we've done it before and we can be back here again. It's a world all about results but our fans have shown understanding and total support.
"There is a connection and a bond that you can see. That doesn't happen very often. We have grown so much, this club is only going in one direction.
"The growth this team have shown makes me really proud. I care about how we go about it and to show the competitive nature we have been able to bring to the league makes us all better. In the end it's just been too much for us."