The hosts created the better of the early chances at the San Siro, but were unable to find a way past an inspired Thibaut Courtois.
The Belgian goalkeeper, on loan at Atletico from Chelsea, produced two stunning first half stops - tipping a stinging drive from Kaka onto the crossbar before going on to push an Andrea Poli header onto the base of the post.
Kaka also grazed the top of the net after combining with Mario Balotelli, while the latter fizzed a curling effort inches past the post as Milan knocked on the door without being able to swing it open.
That remained the case in the second period, with Kaka drilling across the face of goal and Michael Essien planting a free header wide of the upright.
Milan were left to rue their inability to turn pressure into goals seven minutes from time when an Atletico corner was touched on at the near post and Costa back-pedalled to nod powerfully past Christian Abbiati.
For much of the contest it seemed Clarence Seedorf's unrivalled Champions League pedigree might well guide Milan to a valuable win, but the Dutchman - four times a winner of this competition as a player - will have come away hugely frustrated after seeing his charges slip to a damaging defeat.
Although much of the first half would belong to the hosts, it was Diego Simeone's men who threatened first, launching an attack straight from the kick-off and forcing the home defence into a hurried clearance from inside their own box with barely 20 seconds on the clock.
Milan quickly settled to their task though and with a quarter of an hour played forced Courtois into action for the first time, the highly-rated 21-year-old keeping out Kaka with a brilliant save, the slightest touch with the tips of his fingers redirecting the ball away off the woodwork.
Yet the Chelsea loanee managed an even better stop two minutes later, somehow tipping the ball onto the post from Poli's free header just six yards out.
The home side rode their luck in defence when Adel Taarabt tried to play the ball out from the back instead of kicking long, but Atletico were unable to capitalise.
And the action was soon down the other end of the pitch as a slick Milan attack ended with the ball at Kaka's feet 10 yards out but his powerful side-footed effort curled just over the bar.
Three minutes from the break it was Balotelli's turn to step up, the Italy international curling the ball just the wrong side of the upright with a first-time effort.
The game tightened up in the second period, although Kaka should perhaps have done better with a shot which was dragged wide just before the hour.
Balotelli then fired a free-kick into the wall with the continuation of the one-way traffic suggesting Atletico would be more than happy to escape the first leg with a goalless draw ahead of the return in Madrid.
Taraabt fluffed his lines when he was presented with a chance inside the area as the game ticked over into the final 20 minutes, although the momentum soon began to turn.
Raul Garcia stung the palms of Milan goalkeeper Abbiati in the 75th minute as Atletico began to look a little more menacing going forward, and there was further concern for Milan in the 78th minute when Balotelli came off clutching his shoulder.
The game's decisive moment arrived with seven minutes left and is one that Iganzio Abate will want to quickly forget as it was his attempted header from Gabi's corner that span high into the air and back towards his own goal - allowing Costa to convert at the back post.
The goal clearly deflated Milan, who had been good value for at least a draw, and when Adil Rami flashed a ferocious free-kick wide in the closing moments their last chance of salvaging a result had gone.
|Milan||Team Statistics||Atlético de Madrid|
|0||1st Half Goals||0|
|2||Shots on Target||4|
|7||Shots off Target||6|
|53||1st Half Poss.||47|
|50.6||2nd Half Poss.||49.4|