The beleaguered striker has not scored since returning to his boyhood club, but his coach is confident he will hit form soon
Matri's failure to find the back of the net has stretched to seven Serie A appearances since he rejoined the Rossoneri for €11 million this summer.
Nevertheless, Allegri underlined his faith in the ex-Juventus man, and praised the team for securing a vital victory.
"It’s never easy to play as a centre forward, but he [Matri] fought hard, had a few opportunities and will find a goal soon," the trainer assured reporters after the match.
"It's important he keeps faith, as he has always scored goals in his career. It was also important to have Kaka come in from a physical and psychological view.
"We've conceded 13 goals due to lapses, but today we were solid. The midfield worked well to protect the defence, and [Riccardo] Montolivo did well to intercept some attacks.
"Milan played a good game, and though we suffered at some stages, we deserved victory."
Victory has arrived as a timely boost for the San Siro giants, who host Barcelona in the Champions League on Tuesday.