Stoke looked set for a first win in 10 games when Peter Crouch took advantage of Joe Hart's fumble to score. Stoke's lack of threat was hardly a surprise bearing in mind they had managed only seven league goals since the turn of the year.
David Moyes's side had two goals correctly ruled out for offside and Aaron Cresswell forced two fine saves out of Jack Butland with free-kicks, before the Potters scored what appeared to be the victor through Peter Crouch 11 minutes from time.
Sobhi was proving Stoke's primary creative threat and he sent Mame Biram Diouf clear with a cute first-time pass around Declan Rice, but the Senegal striker fired straight at Hart.
It was happening down the other end too as Ramadan Sobhi picked up a pass from Xherdan Shaqiri that allowed him to have a go at Joe Hart, who covered it well in the end.
West Ham were again denied by the linesman's flag moments later when Javier Hernandez struck the ball past Butland, but Carroll was adjudged to have handled inside the area.
But substitute Carroll equalised with a well-taken strike just four minutes after his introduction to dent the visitors' survival fight.
And the English official had to disallow another West Ham goal, Arnautovic in an offside position as he obstructed the view of Butland when the goalkeeper was beaten by Edimilson Fernandes' drive. West Ham turned over Stoke a few months ago.
While the Hammers have played well lately, they only have seven points in their last seven games.
All the same, it was easy to see why they were averaging under a goal per game this season.
A win for West Ham would nearly guarantee their Premier League survival, whilst a victory for the Potters would keep their hopes alive, moving up a spot and to within three points of safety.
Pakistan name five uncapped players for Test tour of England
Mohammad Amir will lead a relatively inexperienced pace attack, which includes Hasan Ali, Mohammad Abbas and Rahat Ali. Many people also reckon that the selection of Imam-ul-Haq over Fawad was not done on the basis of merit and justice.