The twice former champions looked to be heading out when they trailed 2-0 in Frankfurt, Stefan Aigner prodding the German side ahead from close range and Alexander Meier converting a cross to double the lead.
Two second-half headers from defender Eliaquim Mangala made it 2-2 and levelled the tie 4-4 on aggregate.
Eintracht regained the advantage through Meier but Ghilas latched on to a loose ball when keeper Kevin Trapp could only parry a shot and slid the ball into the empty net to give the visitors an away-goal victory.
Ludogorets also came out on top in a thrilling second-leg match.
The Bulgarian side ousted Lazio after an 88th-minute goal from Juninho Quixada gave them a 3-3 home draw and a 4-3 win overall.
Ludogorets had won the first leg against Lazio 1-0 but were quickly behind in the return game when Balde Diao Keita bundled the ball into the net after a minute and Brayan Perea converted an Ogenyi Onazi pass to make it 2-0 on the night early in the second half.
Goals from Roman Bezjak and Hristo Zlatinski made it 2-2 but the Italians again looked set to advance when Miroslav Klose poked in a rebound with eight minutes remaining.
Quixada then pounced on a long pass to flick the ball over the on-rushing Lazio keeper and put the hosts into the last 16.
Serie A champions Juventus comfortably beat Trabzonspor 2-0 in Turkey to progress after winning by the same scoreline in Italy last week while Benfica scored three goals in nine second-half minutes to beat PAOK Salonika 3-0 on the night, 4-0 overall.
Salzburg, who won all six group matches earlier in the competition, thrashed Ajax 6-1 on aggregate after winning 3-1 in Austria in the second leg.
Spanish club Real Betis secured a 3-1 aggregate victory over Russians Rubin Kazan, winning 2-0 away with Nono and Ruben Castro on target.
Sevilla beat Slovenians Maribor 2-1 with goals from Jose Antonio Reyes and Kevin Gameiro to go through 4-3 on aggregate while Viktoria Plzen defeated Shakhtar Donetsk 2-1 to advance 3-2 overall.
Alexandre Lacazette scored in the 80th minute for Lyon against Chernomorets Odessa to progress 1-0 on aggregate and Fiorentina drew 1-1 at home to Esbjerg but went through 4-2 overall.