The Ukrainian side came into the second leg with a healthy looking 3-1 advantage from the opening match in Germany.
However, Gladbach took the lead after 70 minutes when Yevhen Khacheridi put through his own net, and that was doubled eight minutes later with a Juan Arango header.
Ideye Brown's chip two minutes from time eased Dynamo nerves though, and although they were beaten 2-1 on the night their first-leg performance proved decisive.
A goal in extra time from Tulio De Melo saw Lille scrape into the group stage at the expense of FC Copenhagen.
The Ligue 1 side were looking to overturn a 1-0 first-leg deficit and went ahead before the interval at Stade Metropole through Lucas Digne's strike.
The scores remained level after 90 minutes, meaning extra time was needed to see who would progress.
And it was Lille who prevailed with De Melo's header after 105 minutes.
Spartak Moscow also made sure of their place in the next round with a 1-1 draw at Fenerbahce.
The Russians were in front after just six minutes through Ari's close-range finish but Moussa Sow levelled matters in the 70th minute with his header from Alex's corner.
Spartak were then forced to play the last nine minutes with 10 men following the dismissal of Demy de Zeeuw for a second yellow card but they held on for the draw and a 3-2 aggregate success.
Cluj beat Basle 1-0 to wrap up a 3-1 aggregate win.
Pantelis Kapetanos scored the only goal of the night after 20 minutes while Alexander Frei missed a penalty for the Swiss visitors.