Milan seemed in control at the San Siro when Massimo Ambrosini headed them in front after 17 minutes, but a low volley by striker David Di Michele quickly levelled the scores.
Di Michele then took advantage of a lapse in concentration by home defender Fabricio Coloccini to grab his second goal shortly before halftime.
As Coloccini jogged casually towards the ball to gather a backpass he failed to notice Di Michele's strike partner, Dino Fava, rushing up behind him.
Fava's shot rebounded off Milan keeper Christian Abbiati and rolled to Di Michele, who tucked it coolly into the net.
In the second half, Milan coach Carlo Ancelotti sent on striker Filippo Inzaghi, who was returning after a three-month layoff due to an ankle injury, in a bid to find an equaliser.
But it was Ambrosini who again hit the target, this time benefiting from a mistimed jump by Udinese keeper Morgan De Sanctis to nod a Serginho cross into the net.
With six minutes remaining Serginho curled a free kick past De Sanctis to seal the win. As Milan poured forward, Ambrosini nearly completed a hat-trick when he headed against the post.
ROMA VICTORY
In Wednesday's earlier quarter-final, a header by midfielder Daniele De Rossi gave AS Roma a 1-0
It was the second time in four days that Roma had got the better of Fiorentina following a 2-1 Serie A victory on Sunday.
The result also brought disappointment for newly-appointed Fiorentina coach Dino Zoff, who took over from Sergio Buso at the start of the week.
With 13 titles between them, Roma and Fiorentina are among the most successful sides in the history of the competition.
The early exchanges, however, suggested a mismatch.
Even without captain Francesco Totti, who has a muscle strain, Roma dominated the first period and pinned the visitors in their own half.
Strikers Vincenzo Montella and Daniele Corvia tested goalkeeper Cristiano Lupatelli with close range shots early on.
The former Roma keeper reacted quickly but five minutes before the interval Antonio Cassano was barged to the ground on the edge of the area and from the resulting free kick De Rossi headed powerfully into the net.
Fiorentina came out with more determination after the break, but still laboured to break down Roma's defence.
The nearest they came to grabbing an equaliser was when Fabrizio Miccoli forced a diving save from home keeper Carlo Zotti with a drive from outside the area.