Carl Jenkinson went from hero to villain as he gave the Hammers a 1-0 lead with a fine finish after a 10-pass move.
But less than a minute later he upended Dwight Gayle to give away a penalty which Yohan Cabaye dispatched at the second time of asking.
Then it was Gayle's turn to go from hero to villain as he was sent off for two reckless sliding challenges just before half-time.
In the second half the Hammers wore down the 10 men of Palace and waited patiently for the winner which came on 87 minutes when Manuel Lanzini lashed home from six yards.
Dimitri Payet added some gloss to the scoreline with a sublime finish in stoppage time, chipping Palace 'keeper Wayne Hennessey.
So what did we learn about West Ham from the game?
1) France manager Didier Deschamps is wrong to favour Cabaye over Payet
West Ham's new hero Payet has been left out of the last few French squads by manager Didier Deschamps with Cabaye preferred instead in that playmaker role for Les Bleus. Let's hope he was watching this game then which proved that Payet, who wasn't even on top form, is the superior player. Cabaye is class but Payet has skills, pace, power and strength to go with the vision and goals that both players bring to the table. Cabaye did little to cause West Ham problems and was subbed late on while Payet was a constant menace and scored an exquisite goal late on.
2) Manuel Lanzini is the real deal
West Ham fans are waiting for little Manuel Lanzini – who was signed on loan from Al Jazira in the footballing backwater that is the UAE League – to be rubbish. But the diminutive midfield star continues to proves with every passing game that he is the real deal. He is nicknamed 'The Jewel' in his native Argentina and it is easy to see why on this showing. While Payet has deservedly been getting all the headlines for West Ham this season, Lanzini has been the surprise package. His ability, vision and pace has been first class all season but it is his work without the ball, getting stuck in, keeping the shape in midfield, breaking up play which has been just as impressive. Played a part in the 10-pass move which opened the scoring, scored the winner and set up the third. It was his third goal in his debut Premier League season. The only worry is if he carries on like this, all the while his price is being driven up for next summer.
3) Noble MUST up his game to stay in this West Ham side
When Mark Noble was handed the Hammers captaincy by Bilic after Kevin Nolan's departure earlier this season, it was not a huge surprise. After all, he is Mr West Ham. But it did raise eyebrows given that many fans felt his place in the team, unlike previous seasons, is no longer a given. Having signed the likes of Payet, Lanzini, Pedro Obiang, Victor Moses, Michail Antonio and Alex Song to add to a midfield already containing Chiekhou Kouyate, Noble must take his game to new levels to survive. But instead he has started the season very inconsistently and produced another below par display at Selhurst Park. It follows on from a very poor end to last season and some fans questioned whether appointing him skipper was a wise decision given he cannot be guaranteed a place. Initially after being handed the armband, Noble's performances stepped up significantly. But whether it is a more advanced role under Slaven Bilc that is the problem or just the added pressure for places, that form is dipping too often. West Ham won the game in his absence and he could soon find himself out of the side from the start.
4) James Collins proved how important he is to West Ham
Before the close of the transfer window there was a lot of speculation over the future of veteran defender James Collins. The fans' favourite is one of six first team centre backs on the club's books and Bilic went out and spent £8 million on Italian international defender Angelo Ogbonna, which seemed ominous for the "Ginger Pele" as he is affectionately known by the West Ham faithful. But Collins was retained and showed just how vital he is and will be for the club over the course of the season. He was back in the West Ham side in the absence of Winston Reid and was clearly targeted by Alan Pardew as a potential rusty weak link. However, it only served to bring the best out of the experienced Wales international and he was given a standing ovation by the Hammers faithful at the end of the game after battling on through injury to win tackle after tackle and shackle Palace both before and after the crucial sending off. He will be key for Bilic over the course of the campaign.
5) Carroll and Zarate making plan B roles their own
Neither player will like it, but Andy Carroll and Mauro Zarate's performances as second half subs against Palace have only served to make them West Ham's plan B. Neither scored but both played a crucial role in the Hammers running our 3-1 winners. Carroll arched his neck to head Zarate's clever far post cross back across goal to tee up Lanzini for the winner. Then Zarate beat three players before finding Lanzini who in turn released Payet for number three. Both offered a different threat than Palace had faced in Diafra Sakho and it clearly unsettled them. Neither will realistically threaten a fit Sakho's place, though, so bench duty will be the best they can hope for.