Goals from Darijo Srna and Douglas Costa sandwiched a Robert Lewandowski strike and looked to be enough to give Mircea Lucescu's men a crucial lead.
But, with moments left, Shakhtar's defence switched off and allowed an unmarked Hummels to head home from close range.
The match went ahead on a freezing night at the Donbass Arena despite at least four people being killed at Donetsk airport when a plane carrying fans to the game overshot the runway - a minute's silence was held prior to kick-off.
With Shakhtar not having played a competitive match since early December, their rustiness showed, with Dortmund looking lively and creating several chances including a Hummels effort which struck the bar.
However, it was the home side who went ahead on the half-hour when Srna curled home a free kick from 25-yards, although Roman Weidenfeller should have done better.
Lewandowski made sure the German champions were level at the break, although there was an element of luck about it.
Mario Gotze got two attempts at his cross after a botched clearance from Dimitro Chygrynskiy and Lewandowski wrong-footed the defence when he fortuitously miscontrolled the ball. Once the space opened up for him, though, he finished clinically.
The second half saw Dortmund again pushing on as they put together a fine move immediately after the restart but were denied when Marco Reus's shot was blocked.
Shakhtar were happy to counter and with 22 minutes left they looked to have secured a crucial advantage. Chygrynskiy pumped the ball long and Hummels failed to deal with it, which allowed Costa to control and send a wonderful strike beyond Weidenfeller.
Lewandowski and Gotze combined to fashion a swift response but this time the Polish striker sent his volleyed effort wide.
With three minutes to go, Dortmund deservedly equalised - Hummels making up for his earlier error by heading home Marcel Schmelzer's corner.