The Milan boss was forced to watch the match from the stands due to a touchline ban for comments made towards an official.
"The victory is for Allegri and the fans," said El Shaarawy. "We are with him, he has our trust."
Italian forward El Shaarawy also revealed his delight with his role in the squad after his brace at the San Siro.
"Allegri is putting a lot of trust in me, he is making me play a lot this season," he added.
"I'm young, but I try to give my all in every game and I think that I did well today. We had the right spirit today on the pitch, we started looking for a goal from the beginning."
Milan are currently 10th in Serie A.