Barca have now gone three games without a LaLiga win having picked up five points out of a possible 21, suffering defeats by Leganes and Las Palmas in their previous two home games. They are three points behind Atletico having played a game more.
Pedri sent the Catalans ahead but second-half goals from Rodrigo De Paul and Alexander Sorloth helped Diego Simeone's side move three points clear at the top of the table, having played one match fewer than Barca.
Diego Simeone's red-hot Atletico are one of the most in-form teams in Europe on an 11-game winning streak in all competitions and looking like a well-oiled machine with Antoine Griezmann, Julian Alvarez and Rodrigo de Paul firing on all cylinders.
La Liga leaders Barcelona stumbled 1-0 at home against Leganes on Sunday as they suffered another blow in the Spanish title race.
Diego Simeone's side have been in fine form and continued their winning run across all competitions with a deserved home triumph, pulling provisionally level with league leaders Barcelona.
Real missed the chance to move above leaders Barcelona in LaLiga as they stay second on 37 points from 17 matches, one behind the Catalans who host Leganes on Sunday when Atletico, in third place on 35 from 16 games, welcome Getafe.
The 23-year-old was forced off with a muscle injury in their 4-0 thrashing of Osasuna at the Bernabeu earlier in November
"We changed the position of the forwards, with Mbappe outside and he did well, like Vinicius inside," said Ancelotti.
Raphinha and Robert Lewandowski's goals put the Catalans in a healthy position but Marc Casado's red card in the 82nd minute helped Celta start the fightback to snatch a point.
Lewandowski's early disallowed strike led to furious debate over whether the Polish forward had been offside or not.
Hammered by Barcelona in a league Clasico and then outplayed by AC Milan in the Champions League, Carlo Ancelotti's side badly needed this confidence-boosting victory.
Barcelona coach Hansi Flick said he thought playmaker Dani Olmo would be ready despite feeling unwell overnight, while defender Pau Cubarsi can play despite suffering a cut on his face during the team's Champions League win over Red Star Belgrade on Wednesday.
"He's working well, he's training well... it's important for his growth. As long as there is humility, the heart always responds," Simeone told Movistar, while giving credit to Nahuel Molina's pass that led to Giuliano's goal.
"Real Madrid strongly condemns any kind of behaviour involving racism, xenophobia or violence in football and sport, and deeply regrets the insults that a few fans uttered last night in one of the corners of the stadium," said Los Blancos in a statement Sunday.
"We are hurt, it's a tough moment, but I want to thank the fans for their support. We don't have to throw everything away, because there is nothing to throw away," added a downhearted Ancelotti.
The 20-year-old underwent surgery after suffering the injury in Spain's Euro 2024 qualifying win over Georgia last year, and missed the rest of the season, along with Spain's triumph at the Euros.
Madrid beat Celta Vigo on Saturday to pull level with Hansi Flick's side but Barca swiftly restored their advantage with a stylish and dominant display of attacking football.
"Serious cruciate ligament injury confirmed, I'll have to undergo surgery and be off the field for a few months," Carvajal said on Instagram as he posted his picture in an ambulance.
Real Madrid, without injured star striker Kylian Mbappe, largely kept Atletico at arm's length on a spiky night in the Spanish capital, taking the lead through Eder Militao midway through the second half. The match was suspended for around 15 minutes soon afterwards when Atletico fans threw objects including lighters at Madrid players, and Rojiblancos midfielder Marcos Llorente was sent off at the death.