Costa, whose late header earned Atletico a 1-0 first-leg win at San Siro, acrobatically put the Spanish side ahead with the first chance of Tuesday's last-16 second leg but former Real Madrid star Kaka headed Milan level.
Arda Turan's deflected strike made it 2-1 to Atletico before the break, and then second-half goals from Raul Garcia and Costa sealed a deserved 5-1 aggregate victory for the Spanish side at the Vicente Calderon.
Milan were always up against it even before kick-off, with only two teams in the history of the Champions League ever having recovered from losing at home in the first leg to go and win the tie.
And if that was not worrying enough for the Rossoneri, Atletico were one of only two sides still unbeaten in this season's competition - the other being Real Madrid - while the Rojiblancos had won 15 of their last 16 home games in Europe.
History therefore hugely favoured Atletico, and less than three minutes into the contest the present was looking pretty good for Diego Simeone's side as well with Costa continuing his magnificent season with a superb finish to put the hosts ahead.
Koke floated in a cross from the right edge of the area and Costa, having peeled away from Milan centre-back Adil Rami, flung himself at the ball and managed to volley it past Christian Abbiati at full stretch.
That was Costa's sixth goal in this season's Champions League and 27th in all competitions and, of more immediate significance, it left Milan needing to score at least three times to go through.
The mountain had become even bigger for the seven-time European champions, but they got a foothold back into the tie in the 27th minute when Kaka headed home from their first decent opportunity.
Mario Balotelli played the ball out to Andrea Poli and his deep cross was met at the far post by Kaka, whose header flew into the net via the thigh of Atletico defender Juanfran.
That was just the boost Milan needed and they really should have taken a 2-1 lead in the 36th minute but this time Kaka contrived to head a great chance over from six yards.
The Brazil international really should have scored from that, but Atletico survived and four minutes later they were ahead again, albeit with the help of a huge slice of good fortune.
Costa chested the ball down to Arda on the edge of the area and the Turkey midfielder's half-volley took a crucial deflection off Rami before looping into the net.
The momentum was back with the Spanish side now and Garcia almost made it 3-1 with a spectacular overhead kick just before the break, the ball going inches wide with Abbiati rooted to the spot.
Atletico were back on the attack after the interval with recent Spain debutant Costa and Gabi going close before Milan substitute Robinho - another Real Madrid old boy - drew a parry out of Thibaut Courtois with a cross-shot.
Milan were pushing but they could not find a breakthrough before Atletico all but settled the tie in the 71st minute when Garcia climbed above two visiting defenders to head home Gabi's free-kick.
There was no way back for Clarence Seedorf's men after that, although Robinho did hit the crossbar soon after, and Atletico wrapped up a convincing win when Costa drilled a shot in off the far post in the 85th minute.