The recalled captain scored, along with Alexis Saelemaekers, as Roma surprised Lazio on Sunday.
“Pellegrini came to talk to me yesterday and I realised he had this mad desire to be the captain of Roma in the derby,” Ranieri told DAZN.
“I couldn’t wait for him to express that, because we coaches try to motivate players and ask more of them. I put him on against Milan and told him it was not a good performance, but today I was convinced he would do well and told him he would play.
“The goal is in his blood, he is one of the best Italian midfielders when it comes to scoring goals. He didn’t ask me to play, I just got the feeling his mood was where I needed it to be.”
Ranieri also said: “I agree we are now a team, everyone knows what they ought to be doing and how to help each other out. We can keep our shape, which is very important, and now we must continue like this.
“After a poor first half of the season for Roma, we must prove that we’ve come through the tunnel and now we need to start seeing some sunlight. We need a great performance against Bologna, because it really would be terrible to go to Bologna and not replicate this approach.
“The result can depend on many different factors, but the key is that we fight just as hard as we did this evening.”