Stoke midfielder Adam's 65-yard strike soared over Thibaut Courtois to cancel out Eden Hazard's penalty opener before Loic Remy struck the winner after substitute Costa had come and gone.
The 20-goal striker, not considered fit enough to start, was introduced at half-time but lasted just 11 minutes as his fragile hamstrings forced his withdrawal in an injury which could have repercussions for the title race.
Jose Mourinho's Chelsea lead second-placed Arsenal by seven points, with Manchester United a further point behind in third, while holders Manchester City are nine points behind in fourth ahead of Monday's trip to Crystal Palace.
Chelsea's first Premier League title in five years and post-season victory tour are on course, but the Capital One Cup winners were severely tested by a Stoke side denied a first point at Stamford Bridge in 21 years.
Hazard's penalty was just Chelsea's third in the Premier League this season and first for five months, since the home defeat of QPR.
It was a statistic which was highlighted last month by the official website in an article headlined 'Penalty puzzle' in apparent support of Mourinho's frustration with match officials.
Stoke may have had reason to feel aggrieved as Philipp Wollscheid made minimal contact with Cesc Fabregas for the spot-kick.
The Blues then had further cause for complaint as Hazard was felled in the build up to Adam's audacious strike.
Mourinho had been hoping to keep Costa in reserve after a hamstring injury against Hull saw him miss international duty with Spain.
He may have wished he had not called upon the striker at the interval, but Remy ensured the short-term damage was limited and Mourinho punched the air in delight at the final whistle.
Arsenal's win over Liverpool saw the Gunners move within four points of Chelsea ahead of kick-off, having played two games more.
The Blues went close after three minutes when Remy had a shot deflected and Asmir Begovic clawed the ball away.
Begovic then denied the France striker, who next scuffed wide, but Chelsea struggled for rhythm due to poor passes and a disruptive Stoke, who had Glenn Whelan booked for catching Cesc Fabregas late and Ryan Shawcross yellow carded for blocking Oscar.
Chelsea felt Adam should have followed after an aerial challenge with Fabregas which went unpunished.
Stoke might have taken the lead after Nemanja Matic's poor clearance presented Steven Nzonzi with the ball, but the midfielder curled just over.
Hazard tried to spark Chelsea into life and shot weakly at Begovic following a dart across the edge of the 18-yard box.
He then found Oscar, who shot wide rather than return the ball to the Belgian.
Hazard did make the breakthrough after Fabregas wrong footed a sliding Wollscheid to earn Chelsea's first Premier League penalty since November 1.
The lead lasted just five minutes, though, as Hazard fell in the left channel and the ball was fed Adam, who drilled the ball over a back-pedalling Courtois to equalise.
It might have left Mourinho wondering if Petr Cech would have been beaten from that distance, but rather than swap his goalkeeper at half-time, the Blues boss turned to Costa, who came on for Oscar.
Hazard stung the hands of Begovic before Costa departed after a fleeting cameo, grimacing in pain.
Remy stepped up in Costa's absence in netting the winner at Hull last time out and his intervention was decisive again.
Begovic's poor throw towards Nzonzi was intercepted by Willian to Hazard, who ran at the Stoke goal before feeding Remy for a simple finish.
It was the striker's fifth Premier League goal of the season on his fourth start, but he immediately made way for Juan Cuadrado.
Nzonzi hit the outside of the post from 25 yards as Stoke sought to reply swiftly for a second time.
Hazard tried to conjure a third after a one-two with Drogba, but Cuadrado's effort was saved and Begovic smothered the follow up.
Stoke substitute Peter Crouch was booked for clumsily wrapping his legs around Hazard as Chelsea saw out a first home victory in almost two months, since the February 11 defeat of Everton.
Source : PA
Source: PA