Aaron Cresswell’s sweet seventh-minute free-kick had looked like it was going to be enough to secure a Premier League victory for the Upton Park hosts, but Stoke are nothing if not dogged.
The pressure mounted in the home defence as the clock wound down and Arnautovic had already seen two efforts chalked off before he embarked on one final surging run and slid the ball across Adrian into the bottom corner.
The result leaves both teams safely ensconsed in mid-table where they began the day – West Ham in ninth and Stoke in 10th.
Enner Valencia was looking lively on his return from injury and won a free-kick 25 yards out in a central position after seven minutes. Mark Noble shaped to take, but stepped over the deadball and left it to Cresswell who curled the ball past the flat-footed Asmir Begovic.
Stoke’s defence were sitting very deep and struggled to get any support up to Jon Walters. Cheikhou Kouyate found room for a shot to keep Begovic honest, while Valencia almost crept in at the back post after a lung-bursting 50-yard run from Diafro Sakho.
Charlie Adam – seemingly looking to replicate last week’s effort at Stamford Bridge – was going for goal from distance at any opportunity but the accuracy was sorely lacking.
Walters cut in from the left and slid a low shot towards the near post, the ball ending up in the side netting and Victor Moses fired wide as Stoke found some momentum just before the break.
West Ham had lost their early urgency and Arnautovic thought he had levelled when collecting a fine weighted pass into the area from Adam and slotted past Adrian first time, only for the offside flag to be raised.
At the other end, Kouyate’s angled drive was pushed behind while a re-energised Stoke went close again on 80 minutes as Mame Biram Diouf’s header crashed back off the inside of the post.
Arnautovic thought he had equalised in the 92nd minute when converting from Stephen Ireland’s assist, but again the assistant’s flag was up quickly – and correctly.
It looked like the jig was up but Arnautovic had other ideas; he held off two defenders as he bustled into the right side of the penalty area, before deftly sliding the ball across Adrian into the far corner for an unlikely – but ultimtately deserved – point..
West Ham: Adrian (6), Jenkinson (6), Collins (6), Reid (7), Cresswell (7), Song (6), Kouyate (7), Noble (7), Downing (6), Sakho (6), Valencia (8).
Subs: Nolan (7), Amalfitano (6), Cole (6).
Stoke City: Begovic (6), Wilson (6), Shawcross (5), Wollscheid (6), Cameron (7), Whelan (7), Adam (5), Nzonzi (6), Moses (7), Walters (7), Arnautovic (8).
Subs: Pieters (6), Ireland (6), Diouf (7).
Man of the match: Marko Arnautovic