The home side came close to earning a 2-1 win before Mats Hummels headed in with three minutes left to put Dortmund in control of the contest.
© AP Photos
The German side started strongly and they came close to going in front with 16 minutes on the clock as Hummels's header crashed back off the crossbar following a corner.
Shakhtar grew in confidence midway through the half and they took the lead on 30 minutes when Darijo Srna whipped his free kick past the flat-footed Roman Weidenfeller.
However, Dortmund got themselves level five minutes before the half-time whistle through Robert Lewandowski's close-range effort.
After a dull start to the second half, Shakhtar regained the lead with just over 20 minutes left to play when Douglas Costa took advantage of some non-existent defending to fire into the bottom corner.
Lewandowski had a glorious chance soon after to earn his side a second away goal, but he could only smash his volley wide with the goal at his mercy.
With time running out, Dortmund snatched an equaliser in the 87th minute when Hummels thumped home a header.