"The most important thing was we were losing 1-0 and we had the character and trust to go for the win," Pellegrini told BT Sport television.
"In that moment when Liverpool scored their goal we had at least three clear chances to score but they scored first and it's difficult for a team to try to continue playing without being exposed to the counter attack that Liverpool do very well," the Chilean added.
City, champions in 2012 and runners-up last season, are one point behind league leaders Arsenal and two clear of fourth-placed Liverpool.
"I think it was very important to try to finish the year near the top of the table." Pellegrini said.
Liverpool manager Brendan Rodgers took positives from his side's performance despite the fact they were knocked off the top.
"Overall I'm proud of the team, how we played, the charisma in our football and our passing," he said.
"We scored a wonderful goal and we felt we could have had two or three more. To lose we're bitterly disappointed but it was an outstanding performance."
Liverpool winger Raheem Sterling was denied a goal in the first half by a wrong decision to rule him offside before he went on to beat City keeper Joe Hart.
"The three officials were poor in their performance level and we didn't have anything go our way but the players kept on fighting and the game was in the balance until the end," Rodgers said.
City host lowly Crystal Palace on Saturday and Liverpool travel to third-placed Chelsea on Sunday.