A poor start for the Eagles saw them go in at the break 2-0 behind thanks to goals from Javier Hernandez and Andre Ayew, but Luka Milivojevic reduced the arrears from the penalty spot on 50 minutes to set up a grandstand second half.
Only some inspired goalkeeping from Joe Hart managed to deny the Eagles an earlier equaliser, with Roy Hodgson’s team striking the woodwork twice, but with seconds remaining Zaha converted a fine solo effort to lift spirits in SE25.
Unlike the rip-roaring start against Chelsea a fortnight earlier, this game began in very quiet fashion, with the only moment of note from the opening half an hour coming when Patrick van Aanholt was forced off with a tweaked hamstring.
But on 30 minutes the game exploded into life with action at both ends, but unfortunately it led to Palace conceding the opener. After Zaha was denied a penalty by Bobby Madley despite being clumsily clipped by Jose Fonte, the Hammers took advantage of that fortune and countered.
A slick passing move between Manuel Lanzini, Ayew and Aaron Cresswell saw the left-back slip a low centre into the box, and master poacher Hernandez netted with a stylish first-time finish with the outside of his foot to score his fourth of the campaign.
The Eagles nearly found a swift leveller when a spot of head tennis broke out after a corner, leading to James Tomkins forcing Hart to paw the ball back into the danger zone, but as it pinged around the box Jeffrey Schlupp seemed set to turn it home but somehow the ball flicked off the arm of the unbeknownst England’s number one and over the crossbar.
But with three minutes of the half remaining, the hosts’ task got even tougher when Slaven Bilic’s team found a second goal in 12 minutes. A weak backpass on the halfway line by Milivojevic allowed Ayew to race forward, and despite being held up by Scott Dann, he rifled a shot from outside the box into the top corner of Julian Speroni’s goal to score for the third time in four days.
Palace desperately needed something positive soon after the restart, and they got it four minutes into the second half when Andros Townsend was tripped in the box by Angelo Ogbonna, and Milivojevic atoned for his error by sending Hart the wrong way to inject hope into the afternoon.
The momentum instantly flowed towards Hodgson’s team and three minutes after netting their first, they were a whisker away from netting an equaliser when Zaha and Schlupp combined to tee up Yohan Cabaye inside the D, and the Frenchman thumped an arcing effort off the post with Hart beaten, who then had to beat away a Zaha blast after some dazzling feet from the winger.
The Hammers keeper was having a blinder and he made two more good stops when a Zaha drive with his left foot was kept out by a fully-stretched Hart, and then he had to be at his best again when Cabaye curled a delicious 25-yard free-kick over the wall as the pressure built.
As the clock ticked onto 90, he would make another inspired save when Tomkins leapt highest from a corner and the slightest of fingertips by Hart nudged the ball onto the crossbar, but it dropped back into the six yard box where Bakary Sako hooked it over from close range.
It looked as though it was going to be one of those days for the Eagles, and with time ticking away Bilic’s team butchered a three-on-one opportunity on the counter, and from that Palace pounced.
A burst from Loftus-Cheek eventually led to the ball finding its way to Zaha on the far side of the box, who twisted and turned inside the area before eventually getting a shot away, and it finally found its ay past Hart to nestle into the bottom corner to spark wild celebrations around Selhurst Park.
Palace: Speroni, Ward (Sako 59), Dann, Tomkins, Van Aanholt (Fosu-Mensah 11), Loftus-Cheek, Cabaye, Milivojevic, Schlupp, Townsend, Zaha. Subs not used: Hennessey, Riedewald, Kelly, Delaney, Puncheon.
West Ham: Hart, Zabaleta (Antonio 61), Fonte (Rice 76), Ogbonna, Cresswell (Masuaku 46), Kouyate, Noble, Fernandes, Lanzini, Ayew, Hernandez. Subs not used: Adrian, Obiang, Arnautovic, Carroll.