There was a distinct end-of-term feeling about Milan's performance, with the Italians already through the last 16 of the Champions League.
Zenit, though, were cautious of Anderlecht's hunger to win at group winners Malaga, but Danny's first half goal ensured a better return than the Belgians' solitary point from a 2-2 draw.
An uninspiring first half at the San Siro was punctuated by a few half chances and Danny's tame winner.
Milan believed a chance at an opener was due within three minutes but no penalty was given as Bruno Alves climbed all over Giampaolo Pazzini.
Hulk, who scored in the reverse fixture in St Petersburg, nodded Sergei Semak's cross well over the bar and the latter soon tried his luck from distance to no avail.
Cristian Zapata came much closer in the 22nd minute, lurching on to Urby Emanuelson's corner to scoop the ball over the bar from six yards.
But when Zenit created their first solid chance on goal in the 35th minute, Danny put it away.
Semak steered a through-ball into the Portuguese's path, Danny able to drag the ball underneath Cristian Abbiati's grasp when no one cleared the danger.
Bojan Krkic threatened a quick response with an ambitious overhead kick, but his shot sailed wide, with Mathieu Flamini's long-range drive parried away by Viacheslav Malafeev.
Pazzini needed better accuracy to get his headed effort on target as half-time approached, and Zenit would carry their narrow lead into the break.
Milan were much sharper as play resumed and Malafeev was at sixes and sevens to deal with a Pazzini snapshot in the 53rd minute.
Semak and Hulk were still keen, though, with Abbiati wrapping his fingers around the former's long-rang shot before the Brazilian blasted wide of the mark.
Milan clicked once again and substitutes Robinho and Stephan El Shaarawy both went close in the final stages, but Zenit held on for the win.