Liverpool had gone into Christmas top of the table, but ended Boxing Day down in fourth position after letting the lead slip at City.
Philippe Coutinho's 24th-minute goal was cancelled out by Vincent Kompany's header before Alvaro Negredo scored the winner in added time at the end of the first half.
The victory lifted City up to second in the table, still a point off top spot, but Pellegrini acknowledged the importance of not losing to Liverpool.
"It was very important because Liverpool was the best team in the Premier League on top of the table before the match," said the City manager.
"So, if they beat us, they are four points on top of our team, so it was very important, especially when we were losing 1-0, to have the personality of the team to go for the game.
"I'm very, very happy with the response. It's not easy when you face such a difficult team, especially on the counter attack.
"When you're losing 1-0, it's very easy to have space for them, but today I think we defended very well."
City, who are back in action against Crystal Palace on Saturday, are now closer to fulfilling Pellegrini's aim of reaching top spot by new year.
He said: "At least we are near. We will see what happens but this is just half of the Premier League (gone).
"We have all the second half and that will be very close - five or six teams (competing) for the title."