Dortmund displayed a spectacular show at the Amsterdam Arena dominating the match and winning it 4-1 against a young Ajax side.
Phillipe Mexes' brilliant overhead kick, which is now being compared to Zlatan Ibrahimovic's wonder goal, helped Milan qualify after beating Anderlecht 3-1.
Goals from Jack Wilshere and Lukas Podolski saw Arsenal beat Montpellier 2-0 to qualify for the last-16 while a brace from Ezequiel Lavezzi helped PSG go through.
Roberto Di Matteo's side is under pressure of elimination and need a result against Nordsjaelland but also hope Shakhtar beat Juve in the last match of the group stages. Chelsea will become the first defending champions to depart the competition if they fail to qualify.
Lionel Messi is five goals short of beating Gerd Mueller's 85-goal record as Barcelona eased their past Spartak Moscow with a 3-0 victory.
Manchester United suffered a 1-0 loss in Istanbul against Galatasaray while CFR Cluj beat Sporting Braga 3-1 with Rui Pedro scoring a hat-trick. Group H is a battle between Cluj and Galatasaray as United have already secured qualification.
UEFA Champions League 2012/13 results (Tuesday's matches):
Spartak Moscow 0-3 Barcelona
BATE 0-2 Lille
Juventus 3-0 Chelsea
Galatasaray 1-0 Manchester United
Nordsjaelland 2-5 Shakhtar Donetsk
Valencia 1-1 Bayern Munich
Benfica 2-1 Celtic
CFR Cluj 3-1 Sporting Braga
UEFA Champions League 2012/13 results (Wednesday's matches):
Zenit 2-2 Malaga
Arsenal 2-0 Montpellier
Porto 3-0 Dinamo Zagreb
Dynamo Kyiv 0-2 PSG
Schalke 1-0 Olympiakos Piraeus
Anderlecht 1-3 Milan
Ajax 1-4 Borussia Dortmund
Manchester City 1-1 Real Madrid