After a deadlocked first half, Roy Hodgson's struggling side went behind when Stoke's Xherdan Shaqiri scored a brilliant solo goal, the Switzerland star dribbling the length of the Palace half before coolly converting.
Rather than letting their heads drop, Palace surged forward in search of an equaliser and got their reward when Andros Townsend fed Ruben Loftus-Cheek with a dangerous cross and the Chelsea loanee finished clinically from close range.
Stoke looked the more likely to clinch the victory and captain Ryan Shawcross missed a gilt-edged chance from point-blank range before the Potters' three-match unbeaten run was ended at the death by Sakho.
The win is Palace's first since October 14th, when they stunned Chelsea, and gives Hodgson real hope of lifting the club off the bottom of the table if they can continue to play with such determination over the busy festive period.
YESSSSSSSSSSSSS!! pic.twitter.com/4Zkw6hVPFB— Crystal Palace F.C. (@CPFC) November 25, 2017
The home side threatened from the outset, with Townsend jinking his way into the Stoke penalty area after three minutes, but he hesitated over taking a shot and the Potters cleared the danger.
Shaqiri, playing despite tweaking his hamstring in Monday's draw against Brighton and Hove Albion, flashed a shot on the turn past the post as the visitors began to make inroads into the final third.
Palace should have opened the scoring when Wilfried Zaha stormed down the left wing and drilled a low pass across the face of goal straight to the feet of Loftus-Cheek, whose first-time shot was blocked by Stoke's Erik Peters.
Darren Fletcher's raking pass sent Shaqiri clear of the home side's defence after 23 minutes but he took an uncharacteristically poor touch before shooting straight at Wayne Hennessey.
Shaqiri hooked a more impressive attempt just wide from 20 yards 10 minutes later and Stoke remained very much in the game at the break thanks to goalkeeper Lee Grant, who made a one-handed reaction save to stop James McArthur scoring from close range.
Hodgson sent on Christian Benteke after half-time but Stoke came out of the blocks quicker and Hennessey had to rush out of his goal to save at Shaqiri's feet in the first minute of the second half.
The game exploded into life after 53 minutes, when Shaqiri collected the ball just over the halfway line and embarked on a superb run through the Palace defence before picking his spot in the bottom right corner of the net and finding it with a left-footed shot.
Just three minutes later the scores were level again.
Benteke's knock-down allowed Townsend to gather the ball just outside the Stoke box and he whipped in a cross that found Loftus-Cheek, who made no mistake putting the ball into the bottom corner of the net at the far post with his right foot.
Stoke's Peter Crouch caused problems for Palace in the closing stages, heading the ball down for fellow substitute Jese to lash the ball just wide of the target with his right foot from six yards out.
The visitors continued to press for a winning goal and came agonisingly close when Shaqiri arrowed the ball towards the far post and the on-rushing Shawcross managed to divert it away from goal when it seemed easier to score.
But In the 92nd minute, the ever-lively Zaha worked tirelessly down the left and crossed at the second attempt to the far post where Yohan Cabaye's shot came back off the post and into the path of Sakho, who tapped it in from three yards.
Key Opta facts:
- Crystal Palace are unbeaten in their five Premier League home games against Stoke City, winning four and drawing one.
- Mamadou Sakho's goal was the first 90th-minute winner Palace have scored at home in the Premier League since Clinton Morrison's strike against Sheffield Wednesday in May 1998.
- This was Sakho's third goal in the Premier League and his first since April 2016.
- Xherdan Shaqiri has had a hand in six goals in his last six Premier League games (two goals, four assists).
- Shaqiri netted his 10th goal in the Premier League and the seventh from outside the box – only five players have scored a higher percentage of their goals in the competition from outside the area.