Hoffenheim twice took the lead with goals from Kevin Volland and a Roberto Firmino spot kick, either side of a Roman Neustaedter equaliser.
Schalke levelled a second time with an 82nd minute Atsuto Uchida goal but the hosts, who had keeper Tim Wiese to thank for keeping them in the game, grabbed the winner through Schipplock in injury time.
Dortmund were livelier from the start against Stuttgart and should have taken the lead midway through the first half when Mats Hummels' header was palmed onto the bar by Sven Ulreich and his rebound header was cleared off the line by Artur Boka.
Ulreich was also on hand to deny Julian Schieber from nine metres and Robert Lewandowski rattled the crossbar in the 87th minute for the hosts, who are yet to win back-to-back league games this season.
Dortmund also suffered an injury blow when captain Sebastian Kehl was forced off in the 20th minute with a suspected broken nose after getting an elbow in the face, making him a doubt for the trip to Spain.
Hanover 96 bounced back from consecutive defeats to beat Augsburg 2-0 and move up to sixth on 14 points while Nuremberg beat VfL Wolfsburg 1-0 with Timo Gebhart heading in a Timothy Chanlder cross.
Borussia Moenchengladbach and Freiburg drew 1-1 to share the spoils in their mid-table clash.