Scamacca has scored six times in his last 10 games for the Hammers since a £30 million move from Sassuolo, but David Moyes' men were forced to come from behind at the London Stadium.
Fulham were without talisman Aleksandar Mitrovic through injury but went in front after just five minutes when Andreas Pereira smashed in from a narrow angle. Jarrod Bowen levelled from the penalty spot before half-time after Pereira brought down Craig Dawson in the box.
Scamacca then produced a moment of magic as he lofted Lucas Paqueta's pass over the helpless Bernd Leno. The Italian international has displaced Michail Antonio as Moyes' first-choice striker, but the Jamaican came off the bench to secure the three points in stoppage time. After winning just one of their first seven league games, back-to-back victories have lifted West Ham to within four points of the top six.
Palace also came from behind after falling behind to Pascal Struijk's early goal for Leeds at Selhurst Park. Odsonne Edouard headed in Eberechi Eze's free-kick to quickly level and Eze won the game 14 minutes from time with a fine low strike from Wilfried Zaha's backheel.
Arsenal are aiming to move back to the top of the table when they host Liverpool later at the Emirates. The Gunners fell two points behind Manchester City on Saturday after the champions thrashed Southampton 4-0. Liverpool are also in desperate need of a win as they trail City by 13 points after winning just two of their opening seven Premier League games of the campaign.
Manchester United are also in action later on Sunday when the Red Devils travel to Everton.