For nearly an hour Milan suffered similar frustrations to last week, when they slipped to a 1-0 defeat, but Ibrahimovic broke the deadlock in the 57th minute.
Robinho doubled the lead in the 73rd minute, before Ibrahimovic grabbed his second in the last minute.
It was a much needed win for Milan, who had fallen four points behind Juventus after the Serie A leaders beat Atalanta.
The hosts were first to threaten, though, as Marco Rigoni headed Michel Morganella's cross wide.
Ibrahimovic had an opening in the 12th minute but his shot from outside the box was saved well by Samir Ujkani, and Robinho fired a free-kick wide moments later.
At the other end Rigoni picked out Andrea Caracciolo who shot wide, but it was Milan who were looking more dangerous.
Mark van Bommel and Robinho were both wayward, before Ujkani was again equal to Ibrahimovic in the 23rd minute.
Indeed, by half-time the Swedish striker must have been sick of the sight of Ujkani, who twice more repelled decent efforts as the teams went in goalless at half-time.
Milan goalkeeper Marco Amelia was worked for the first time two minutes after the restart when he saved a shot from Caracciolo from the centre of the area.
Stephan El Shaarawy for Milan and Rigoni for the hosts also missed chances in a breathless start to the second period.
Milan could breathe a sigh of relief just before the hour mark though as Ibrahimovic took a pass from deep from Massimo Ambrosini and finally beat Ujkani.
And Robinho was left with a tap-in to double the advantage midway through the second half after good work from El Shaarawy.
Giuseppe Gemiti came closest to pulling one back a minute from time when his shot was well saved by Amelia.
But a minute later it was 3-0 as Ibrahimovic had the last laugh, beating Ujkani from outside the area.