Real Madrid moved three points ahead of their rivals thanks to goals from Ballon D'or favourite Karim Benzema, Federico Valverde and a late Rodrygo Goes penalty, with Ferran Torres pulling one back for the visitors at the Santiago Bernabeu stadium.
Los Blancos gained some measure of revenge after Barcelona won the corresponding fixture 4-0 last season while the European champions have now won six of the last seven encounters between the two sides across all competitions.
When asked what was the key to his side's victory, Ancelotti told DAZN: "Everything. We had to make a complete match, and we did it.
"It is true that the beginning was good, we got ahead quite early and we controlled it well in the second half. We had a lot of confidence, with and without the ball.
"It was clear that [Eder] Militao had to put pressure on [Robert] Lewandowski. We controlled the players well between the lines with [Toni] Kroos and [Aurelien] Tchouameni."
Real Madrid's second goal from Valverde was the Uruguayan's fourth in nine league matches this season after going the entirety of the 2021/2022 campaign without a single goal in the competition.
"I try to enjoy in each position, to give the maximum in each position," Valverde added.
"I know that above, I can contribute with goals and assists, and in the middle with work and energy. I was able to score and I'm very happy.
"We knew it would cost. I think we worked well, we knew how to defend and suffer, and in attack, we came out quickly."