With just 12 minutes to go, the Gunners were behind to their Premier League rivals after Alessandro Diamanti had put the struggling Hammers ahead on the stroke of half-time.
But in the 78th minute Aaron Ramsey equalized with a fierce shot from close range after the 19-year-old Wales midfielder had been neatly played in by Carlos Vela.
Five minutes later Arsenal had the lead when Eduardo rose high to power in a header for the ten-time FA Cup winners.