Allegri's future has come under increasing speculation in recent weeks, with Roma consistently linked with a summer swoop for the Milan coach.
He told Mediaset Premium: "It is an important goal, but it will only be truly important if we manage to keep this gap over the next few rounds.
"When I got here, Allegri was in charge and we get on really well. I hope he stays, as I'm really happy with him. If I were the club, I'd do everything to keep hold of him.
"I am just one of the players here and we all contribute. I was unable to get into gear today and it was a bad performance, but eventually we managed to get the points."
The Rossoneri are now four points clear of Fiorentina in the race for Champions League qualification.