Al Ahli Tripoli drew 2-2 away to Zamalek on Sunday to ensure they pipped the Egyptian side to a place in the CAF Champions League quarter-finals.
The five-time winners needed a victory to claim second spot in Group B following their shock defeat to CAPS United last week.
They started in strong fashion in Cairo and took the lead through Bassem Morsi after 13 minutes, but Mahmoud Hamdi El Wensh was sent off for a second bookable offence after conceding a penalty in first-half injury time, allowing Mohamed Al Ganodi to equalise from the spot.
Vianney Mabide put the Libyans 2-1 up after 69 minutes to put the game firmly under their control, and although Moruf Yusuf equalised to set up a nervy final quarter of an hour, the visitors held out to claim their last-eight spot.
Al Ahli go through in second place in the group behind USM Alger, who were comfortable 4-1 winners over CAPS United.
In Group C, Mamelodi Sundowns lost out on top spot to ES Tunis after being held to a 1-1 draw by AS Vita Club.
Yazid Atouba cancelled out Thabo Nthethe's opener in Pretoria to deny the holders any hope of snatching first place in the standings.
Tunis finished three points clear at the top thanks to a 4-0 win over Kedus Giorgis courtesy of goals from Khalil Chemmam, Bilel Mejri, Haythem Jouini and Ali Machani.