Pervis Estupinan struck for the Rossonero to earn the 1-0 triumph.
The win took Milan into second-place on the table, seven points behind Inter.
Allegri smiled afterwards: "No, no: we're not talking about Allegri's miracles. We're talking about football matches and the guys who wanted to win. We've done poorly at home lately, with only one point from two games.
"We've reached 60 points, and now we have to take another step forward because it's not enough to qualify for the Champions League.
"But I think Inter remains the clear favorite for the Scudetto: they're a strong team and to beat them you have to put in strong performances like the lads did tonight."
