Madrid remained two points adrift of Barcelona and three behind leaders Atletico Madrid with a convincing win, crowned by two late goals.
"We played very well, intelligently," Ancelotti said. "We started at a very high pace and had more intensity in the second half. Everyone had a good game and I'm pleased because it wasn't easy.
"I'm very proud to manage this team. I have players who like to fight and we're going to fight until the last match."
Madrid were playing just three days after their 3-0 Champions League quarter-final first-leg win over Borussia Dortmund and Ancelotti was pleased with his team's recovery.
"It's not easy to recover well from Wednesday's match and the players had very good intensity levels in the second half," he said.
"They all worked well defensively. We avoided Real Sociedad's biggest quality, which is depth. We did very well at the back and we were very focused."