Manchester United continued their recent revival with a fourth successive win which strengthens their place in the Premier League top four.
The home side led when Marouane Fellaini headed in Ander Herrera’s left-wing cross at the far post.
Stoke equalised through Steven N’Zonzi’s low shot, but they slipped to a third straight loss when Juan Mata’s free-kick from the right sneaked in.
However, Stoke’s Mame Biram Diouf was twice denied an injury-time equaliser.
The 26-year-old Stoke forward, who had an undistinguished spell at Old Trafford earlier in his career, saw United keeper David De Gea claw out his header before emergency full-back Ashley Young cleared another effort off the line seconds later.
Diouf was left mystified at the final whistle by his inability to earn a point for the visitors, shaking his head in disbelief as he slowly trudged off the pitch.
A draw would have been harsh on United, who controlled the game throughout, but had to rely on a piece of fortune for the winner.
Spain midfielder Mata’s set-piece evaded all the players waiting in the penalty area, although team-mate Marcos Rojo claimed he flicked in the final touch.
However, United boss Louis van Gaal will not be too bothered about the identity of the goalscorer. The Dutchman breathed a huge sigh of relief as he marched down the Old Trafford tunnel as his team continue to build momentum, despite failing to turn almost 70% of possession into more goals.
Van Gaal was unable to call on skipper Wayne Rooney or Angel Di Maria, with the pair missing from United’s squad through injuries sustained against Hull on Saturday.
And for large periods, the home side sorely missed the pair’s attacking guile.
But Stoke rarely looked like ending a dismal run of 11 successive Old Trafford defeats – until the late drama involving Diouf.
Old Trafford lost some of its famed ‘fear factor’ last season as United slumped to seven home Premier League defeats in a terrible first campaign following Sir Alex Ferguson’s retirement.
That aura of invincibility appears to have returned under Van Gaal, whose team have taken 19 home points from a possible 21 since defeat by Swansea on the opening day.
Potters boss Mark Hughes indicated his side would not be afraid to “have a go” at United, but they rarely looked like carving open a makeshift home defence until stoppage time.
United controlled the tempo and deservedly led when Spanish midfielder Herrera was allowed too much time and space to pick out Fellaini, who outjumped Erik Pieters to powerfully nod in.
Hughes was furious with the space that his side allowed Herrera, but his demeanour changed when N’Zonzi calmly guided a 20-yard shot past De Gea with Stoke’s first attempt on goal.
But Mata’s intervention moved United within two points of second-placed Manchester City, who travel to Sunderland on Wednesday, while Stoke remain four points above the relegation zone.