West Ham ensured a fairytale finish to life at Upton Park with a deserved victory over Louis van Gaal's side in a five goal thriller in a contest marred by ugly pre-match scenes.
Kick-off was delayed by 45 minutes after the visitors coach was attacked by rocks and bottles and, once the match did get underway, the home side dominated from the off and went ahead inside ten minutes.
Manuel Lanzini found space down the left and picked out a cross for the unmarked Senegalese striker whose shot took a deflection off Daley Blind on its way in.
Dimitri Payet fired straight at the exposed David De Gea, and the Spanish stopper then came to his side's rescue again when he saved at the feet of Andy Carroll after the striker was left on his own clean through.
Michail Antonio had an effort disallowed, Payet again lashed wide from distance and Sakho sent a free header over the bar with the visitors fortunate to make it to the break only one goal behind.
Despite having being second best, the Reds somehow found themselves level six minutes after the break.
De Gea found Marcus Rashford with a long ball forward, the teenager slipped in Juan Mata who in turn crossed for the onrushing Anthony Martial to tap in from close range totally against the run of play.
Payet fired into the side netting, Sakho should have done better with a free header from a set-piece and Martial headed off the line to keep out Carroll.
Having weathered the storm, the Reds turned the game on its head and moved to within sight of a priceless victory with a moment of magic from the excellent Martial 20 minutes from time.
Neat play from Rooney found to Rashford who picked out the Frenchman to burst free down the left and clip home a superb finish over the advancing Darren Randolph on the angle.
In this superb, see-sawing encounter, however, the lead was to last only four minutes as Slaven Bilic's side turned the match on its head with two goals in quick succession.
First, Payet's whipped ball found Antonio who headed home from close range to level and then Winston Reid met another delivery from the again impressive Frenchman to nod in the winner four minutes from time as the stadium erupted.
The fight for a top-four place will still go to the final day, but United's fate now lies in the hands of others.
Overall team performance: 5.5/10
United Faithful Man of the Match: Tony Martial, by a distance.