A dramatic last-minute penalty from Liam Lawrence gave Stoke a share of the points against Barnsley at Oakwell.
The Potters were heading for their first defeat in seven games but were handed a lifeline when Stephen Foster was dismissed for a foul on Ricardo Fuller.
Lawrence stepped up to convert and Lawrence grabbed his second penalty of the game, and complete his hat-trick.
It was the home side who had the first chance of the game when from a free-kick Grant McCann forced a save from Steve Simonsen from 35 yards in the opening two minutes.
Stoke were soon into their stride though and Lawrence was proving to be the dangerman - the winger forcing a clearance from Sam Togwell while his corner forced Heinz Muller to punch the ball to safety.
Barnsley's chances in the opening 20 minutes were few and far between, with the only opportunity falling to Jon Macken, who blasted Howard's cross over the crossbar.
Lawrence tried his luck again with a right-footed volley but after 23 minutes a foul by Richard Cresswell on McCann gave Barnsley a penalty and Brian Howard stepped forward to convert and give the home side a shock lead.
Stoke pushed forward and this time Lawrence's cross found Ryan Shawcross, who headed the ball wide.
Barnsley went close to increasing their lead when McCann forced Simonsen into action but their advantage was short-lived.
On the stroke of 30 minutes, the visitors levelled the scores with a penalty. Dennis Souza was adjudged to have fouled Ricardo Fuller and Lawrence stepped up to coolly converted the spot-kick.
Stoke could have added more with Lawrence again causing the Tykes' defence problems while Mamady Sidibe also went close with his header.
Barnsley almost re-established their lead in the opening minutes of the second half.
Shawcross blocked Istvan Ferenczi's 25-yard shot and the resulting corner from McCann forced a clearance from John Eustace and eventually a save from Simonsen.
At the other end, Stoke had their chances of going ahead. Togwell's foul on Rory Delap and the resulting free-kick from 25 yards saw Lawrence's effort hit the bar.
It was a missed chance that ended up costing the Potters as Barnsley grabbed their second goal thanks to a headed effort from Macken, who latched onto a cross from Martin Devaney.
Both sides pushed forward, Fuller and Lawrence going close for Stoke, while Barnsley tried to increase their lead through Ferenczi and Devaney was unlucky not to have increased the Tykes' lead further when he forced a fine save from Simonsen.
And Simonsen was called into action again to deal with a curling shot from Howard. But the Tykes were left to rue their missed chances as Lawrence popped up to grab his second of the game and draw Stoke level with a six-yard shot on 82 minutes.
The Potters barely had time to celebrate their goal when Barnsley re-established their lead.
Martin Devaney's initial shot was fumbled away by Simonsen, straight into the path of Macken who made no mistake in sending the ball into the back of the net.
A foul on Fuller by Foster, who was send off for his second bookable offence, earned Stoke a penalty and Lawrence made no mistake in converting.
Teams:
Barnsley Muller, Foster, Souza, Nyatanga, Van Homoet, Devaney (Hassell 90), Togwell, Howard, McCann,Ferenczi (Odejayi 81), Macken.
Subs Not Used: Johnson, Mostto, Ricketts.
Sent Off: Foster (90).
Booked: Souza, Howard, Foster, Macken.
Goals: Howard 23 pen, Macken 66, 85.
Stoke Simonsen, Wilkinson, Shawcross, Cort, Pugh, Lawrence, Eustace, Delap, Cresswell, Sidibe (Parkin 77), Fuller.
Subs Not Used: Hoult, Zakuani, Pulis, Dickinson.
Booked: Pugh, Shawcross, Lawrence.
Goals: Lawrence 31 pen, 84, 90 pen.
Att: 12,398
Ref: Trevor Kettle (Rutland).