Leading 5-0 from the first leg, Brendan Rodgers’ side fell behind on the night when Dimitri Shomko’s shot was diverted into the net by Kristoffer Ajer.
And though Scott Sinclair produced a stylish equaliser, Serikzhan Muzhikov and Patrick Twumasi (2) put the hosts 4-1 up with 20 minutes still to play.
But Olivier Ntcham and Leigh Griffiths made the tie safe for the visitors.
It is Celtic’s first defeat in all competitions since losing to Barcelona in Glasgow on 23 November, but they can now look forward to their 10th appearance in the group stage.
The Scottish champions will be in the fourth pot of seeds for Thursday’s draw in Monaco unless Liverpool fail to progress against Hoffenheim on Wednesday.
Rodgers has now led Celtic to the group stage in each of his two seasons as manager, his side having taken on Barcelona, Manchester City and Borussia Monchengladbach last year.
With Astana faced with such a sizeable first-leg deficit, Celtic may have expected an early onslaught from their hosts in Kazakhstan, but the visitors looked the more incisive early on.
After earlier chances for Sinclair and team-mate Callum McGregor, there seemed to be no imminent danger to Celtic’s lead until Shomko’s speculative shot was deflected by Ajer’s outstretched foot to wrong-foot keeper Craig Gordon.
Astana had restored some belief but their enthusiasm was blunted when Sinclair collected on Celtic’s left, drove at the defence and curled a sumptuous shot past Nenad Eric. It was the Englishman’s third goal of the tie.
The home side needed six more goals at that stage and Marin Anicic’s header was superbly clawed over by Gordon as half-time approached.
Astana capitalised on a poor Scott Brown pass to get ahead early in the second period, Srdan Grahovac’s chipped ball deflecting into Muzhikov’s path for a straightforward finish.