Former Milan coach Sinisa Mihajlovic saw his Torino side take a deserved first-half lead when Andrea Belotti fired the visitor ahead, but the in-form Rossoneri burst into life after the interval.
Club legend Arrigo Sacchi said before the game that Vincenzo Montella was "painting a masterpiece" at Milan, and the guile and menace with which they broke Torino down after an hour at San Siro suggested the praise was justified.
Spanish midfielder Suso emerged as the architect of the victory, launching an attack that saw Juraj Kucka lash home a 61st-minute equaliser and then delivering a pinpoint pass that Giacomo Bonaventura volleyed home to give Milan the lead.
Torino, which had Antonio Barreca sent off in the dying minutes, matched its host for long periods of the game but ultimately lacked the cutting edge that should give Montella's men a chance of revenge when they meet champion Juve in the quarter-finals.
The visitor launched into attack from the kick-off and soon won a free-kick that Adem Ljajic sent narrowly over, before he produced a cross that sat up nicely for Marco Benassi, but Milan's Gustavo Gomez made an important block.
Belotti was a tightly marked man and Gabriel Paletta left him requiring a new boot after a particularly tough challenge, while at the other end Barreca gave the ball away sloppily to Bonaventura but sprinted back to recover the ball and clear his lines.
Having pressed and harried their hosts for 27 minutes, Torino deservedly took the lead when Benassi broke away with only two Milan defenders ahead of him and slotted a throughball to Belotti, who applied a simple finish.
Despite being given ample space and possession in Torino's half, Milan failed to break Mihajlovic's side down and Kucka's volleyed effort from 20 yards was the closest it came to a first-half equaliser.
Shortly after the restart Torino goalkeeper Joe Hart suffered a head injury after claiming the ball at the feet of Gianluca Lapadula and getting caught by the Italian's studs, but the Manchester City loanee played on with a bandage around his head while Lapadula received a yellow card.
Jose Sosa sent a header just wide before Suso danced through the Torino defence and fired a shot that Hart could only parry, allowing Bonaventura to send over a cross for Kucka to slam high into the net and restore parity.
And the turnaround was soon completed as Suso again split the Torino defence, this time with a delicately chipped ball that Bonaventura met with a deft volley, which Hart could only watch flash past him into the net.
Milan had Gianluigi Donnarumma to thank for preserving its lead when his lightning reflexes prevented Belotti from beating him with a low drive, but Torino ran out of steam and their evening was spoiled further shortly before full-time when Barreca was shown a second yellow card for a cynical challenge on Suso.