Leaders Chelsea travelled to the Etihad Stadium having won seven consecutive matches, during which time they had conceded just one goal.
Antonio Conte's men were staring down the barrel of a first defeat since September, though, when Gary Cahill diverted Jesus Navas's cross into his own goal on the stroke of half-time.
But a thrilling encounter turned when Kevin De Bruyne smashed the crossbar with the goal unguarded, with Costa levelling soon after.
Cesc Fabregas, starting a league match for just the second time this season in the absence of the injured Nemanja Matic, evoked memories of Chelsea's title-winning 2014-2015 season when he played a stunning long ball from which Costa scored his 11th league goal of the campaign to restore parity.
Chelsea then completed the turnaround with 20 minutes remaining thanks to Willian's cool finish from a brilliant Blues counter-attack.
Hazard then added late gloss to the scoreline for Chelsea, before the contest ended in ugly circumstances as Sergio Aguero saw red for a dreadful lunge on David Luiz, with Fernandinho also dismissed for his role in the resulting melee.
In a high-octane opening David Silva saw a penalty claim for handball against a sliding Cahill waved away, while at the other end Hazard bent a shot just past the right post from 20 yards after good work from Pedro.
City had the ball in the net when Fernandinho headed home Silva's free-kick, only to be rightly flagged for offside.
The hosts began to gain a foothold and Silva's sumptuous ball was knocked across goal by Leroy Sane to Aguero, whose shot was brilliantly blocked by Cahill.