A fairly even opening half saw Everton produce the best chances, the hosts enjoying the majority of their attacking joy on the break as West Ham struggled to cope with the pace of forward trio Kevin Mirallas, Steven Naismith and Lukaku.
But they failed to take them, with Lukaku and Naismith firing wide after some lovely build-up play, while they were constantly put under pressure at the back from a succession of West Ham corners.
Everton started brightly out of the half-time break, with Mirallas going close with a speculative lob, but West Ham still posed a threat, with on-loan Arsenal full-back Carl Jenkinson testing the gloves of stand-in Toffees goalkeeper Joel Robles with a low effort.
The end-to-end action continued but eventually the Hammers’ constant presence at the corner flag bore fruit, with Collins evading his marker with a clever run and rising at the near post to power in a wonderful header.
It was a deserved opener for Allardyce’s men, who went close to doubling their lead moments later when unmarked striker Enner Valencia saw his close-range header tipped over the bar by a brilliant reaction save from Robles.
Everton then looked to have levelled against the run of play when Lukaku beat Aaron Cresswell in the air to steer a header into the far corner of the net, only for referee Anthony Taylor to harshly chalk the goal off for a foul.
West Ham looked moments away from booking their place in the fourth round when Everton suddenly upped the tempo in the closing stages.
And Lukaku was there to bail out the out-of-form Toffees in injury-time, the big Belgian bringing down Bryan Oviedo’s cross before firing a volley past Adrian to seal an unlikely draw.
Meanwhile, Scunthorpe and Chesterfield also face a replay to decide who will progress into the fourth round after an 85th minute goal from Spireites forward Jay O’Shea secured a 2-2 draw at Glanford Park.
United took the lead inside 20 minutes when Alex Davey fired home from outside the box, and the hosts made it two before the break thanks to Lyle Taylor’s close-range finish.
But Chesterfield rallied in the second-half with Eoin Doyle pulling one back with a 70th minute penalty, and, after piling on the pressure in the final 20 minutes, O’Shea deservedly levelled with a clinical finish to take the tie back to the Proact Stadium.