Kaka, who is in his second spell at Milan, scored twice to take his tally to 101 goals for the club. Teenage striker Bryan Cristante scored the third in his first start.
Ajax's 2-1 win over already qualified Barcelona means the Dutch champions and Milan will battle it out for the other place in the knockout stages out of Group H, while Celtic, who will finish bottom, head to the Nou Camp for the final group game with nothing but pride to play for.
Kaka and company travelled to Glasgow on Monday sitting a lowly 13th in Serie A on the back of a dismal run of five league matches and another defeat at Parkhead would deal a blow to their hopes of making the Champions League knock-out stages.
Atletico Madrid and Barcelona joined Manchester City and defending champions Bayern Munich in qualifying for the last 16 with two group games remaining.
Injury-hit Milan opened the scoring in the ninth minute when Robinho pounced on a defensive error to hold off Gerard Pique and beat Victor Valdes in the visitors' goal after a nice one-two with compatriot Kaka.
Birsa was given a role in the 'hole' behind Robinho and Alessandro Matri and scored the winner in a 1-0 win over Udinese
Kaka, expected to be out for at least two weeks, will now be unavailable for the Rossoneri when they host Celtic in their opening Champions League Group game at the San Siro on Wednesday.
Kaka spent six highly successful seasons with Milan from 2003-2009, winning the Champions League and Ballon d'Or trophy for the world's best player before signing for Real Madrid.
Kaka was one of Real's most expensive signings in 2009 when the club paid Milan 65 million euros for him after a highly-succesful six-season spell with the Rossoneri.
The Brazilian was also said to have taken a significant pay cut to facilitate his move to the San Siro, accepting an annual salary of four million euros plus bonuses, a considerable reduction from the 10 million euros a year he received in Madrid.