Inter's win, coupled with Juventus's 1-1 draw at home to Cagliari, means the top five are now separated by just six points.
Ranieri freely admitted that his side were back in the mix but refused to discuss the title.
"I've said it since day one, I won't talk about [the title] due to modesty and superstition," he said.
"The first thing for us was that it was important to get into the Europa League zone and we've done that.
"Next up is the Champions League zone. We have it in our blood and in our DNA to fight for the top positions. But we'll keep going slowly because we're doing well but we still need to improve."
Inter are the form team in the league and as well as ending Milan's 12-match unbeaten run, they won for the eighth time in nine matches.
However, during their disastrous start, in which they won only two of their first nine games, they lost all their previous clashes with title rivals.
"We're taking giant steps and that's important, it was important to beat Milan as it was the first match we've won against a direct (title) rival," said Ranieri.
"We had three before against Juventus, Napoli and Udinese which served as lessons.
"We played well, we were careful tactically. We're playing well, we've rediscovered our pride and compactness, we've got the right energy back."
Diego Milito scored the winner when Ignazio Abate over-committed himelf in trying to cut out a cross from Javier Zanetti, missing it and leaving the Argentine poacher to run on and slip the ball home.
"It was a great game against quality opposition, I'm delighted," the match-winner said.
"It was an important test both for the standings and our morale. It's great to win the derby."
With Juve drawing and third placed Udinese losing 3-2 at Genoa, Milan are now a point behind the Old Lady of Turin.
Udinese are two points behind that and another pair of points ahead of Lazio, 2-0 winners over Atalanta.
Inter are a point behind the Romans and Milan coach Massimiliano Allegri said that means they're right back in it.
Although he said the defeat hadn't hurt his side too much.
"It doesn't turn things on their head, it's a day in which the top three picked up just one point so nothing's changed," said Allegri.
"All that's happened is we lost the derby and now Inter are back in the title race."
He said there was little in the match to separate the teams, with Inter exploiting one chance on the counter.
"We forced the play while they waited for our mistakes to hit us on the counter, which they did well," said Allegri.
"We didn't create a lot but it wasn't easy because Inter were playing with 10 men behind the ball and they're physical."
It completed a turbulent week for Milan in which they appeared set to tie up a deal to sign Carlos Tevez from Manchester City and sell Pato – who was jeered by some sections of fans when he was substituted in the second half – to Paris St Germain.
Pato refused to leave, leading to the Tevez deal falling through.
A day later Allegri signed a contract extension in a move that looked like an attempt to appease fans who may have been upset at missing out on Tevez, while also giving the team a boost ahead of the derby.
"It was a busy week and we didn't need that," added Allegri. "Until (Sunday) we were top but during this week it seemed as if we were in the middle of problems.
"We don't have problems and we'll fight for the title."