Stewart Downing had given West Ham the lead in the 62nd minute before a Leon Osman volley drew Everton level six minutes later.
But the Belgian stole in to head Aiden McGeady’s cross in from three yards out in the third minute of stoppage time.
In a subdued first-half neither side were able to create many chances although West Ham will feel they should have been awarded a penalty in the 13th minute when Aaron Cresswell’s cross clearly struck Seamus Coleman’s hand.
Referee Kevin Friend indicated that the defender had been so close that he was unable to get his arm out of the way although the replays suggested otherwise.
Lukaku fired Everton’s best chance of the half over the top from 15 yards, having cut back onto this favoured left foot while Downing came closest for the hosts.
The former Liverpool man turned Gareth Barry in the middle of the pitch before surging forward and driving a shot at goal, only for Tim Howard to beat it to safety.
With little to play for for either side it was no surprise that it took a goal to shake the game out of its slumber. Downing had been the Hammers’ most threatening player throughout and he punished Everton with a well taken strike.
Cheikhou Kouyate fed the winger in the inside right channel of the penalty area and after getting the ball out of his feet with his first touch, Downing curled a low shot beyond Howard into the far corner with his second.
Everton responded well though and hit back soon after. Lukaku crossed from the right and Osman controlled the ball well before hooking the ball into the back of the net.
From that moment the game opened up with both sides pushing for a winner, but neither was able to create a clear-cut goalscoring opportunity before Lukaku’s last gasp intervention.
West Ham: Adrian (6); Jenkinson (6), Collins (5), Reid (6), Cresswell (6); Song (5), Kouyate (7), Noble (5); Downing (7), Valencia (7), Cole (4).
Subs: Burke (6), Nene (6).
Everton: Howard (5); Coleman (6), Stones (7), Jagielka (7), Galloway (6); McCarthy (6), Barry (6); Lennon (6), Barkley (6), Osman (7); Lukaku (7).
Subs: Mirallas (5), McGeady (7).
Man of the match: John Stones.