Match ends, Scotland 2, Germany 3.
Defeat by Germany leaves Scotland scrambling for points from their last two qualifiers to reach the play-offs for Euro 2016.
Thomas Muller's shot deflected past David Marshall to put Germany ahead.
Mats Hummels scored an own goal after Manuel Neuer could only palm Shaun Maloney's free-kick off the defender.
Germany went in front again as Muller headed in and, although James McArthur fired Scotland level, Ilkay Gundogan slotted home the visitors' winner.
How Scotland can still qualify
Scotland, following Republic of Ireland's win over Georgia on Monday, need to take at least four points from their last two games and hope the Irish lose twice if they are to snatch third place.
Martin O'Neill's Ireland end their campaign with a home fixture against Germany and a trip to Poland - thus facing a difficult end to qualifying.
Gordon Strachan's men play Poland (h) and Gibraltar (a) in October - and former Scotland international Pat Nevin is confident that they can still claim a play-off place.
"If the Republic of Ireland don't get any more points, which would be unsurprising, and Scotland draw with Poland and get a win against Gibraltar, they would get third," Nevin told BBC Sport. "I think that is fairly likely. Ireland still have to do something very special."
There are nine qualifying groups and the team that finishes with the best record in third claims an automatic place. The other eight teams finishing third go through to a play-off stage.
If Scotland and Republic of Ireland both finish on 15 points then Strachan's team would progress because they have the better head-to-head record.
Scots improvement despite defeat
Scotland's dismal 1-0 defeat in Georgia on Friday meant points against Germany were vital if Strachan's side were to have a realistic chance of automatic qualification for the finals in France.
The hosts were never likely to cut Germany open, with their best hope of hurting Joachim Low's side always likely to come from set pieces.
So it proved, as Maloney's delivery from wide on the left was too hot for Neuer to handle and McArthur's strike came as he lurked on the edge of the penalty area to capitalise on a half-cleared corner to make it 2-2.
Unfortunately for Strachan's side, their resolve was not sufficient to keep Germany dominating possession and sealing the win.
Germans' masterful movement
Germany remain a little suspect in defence but they can afford to be with the quality they possess going forward.
Their full-backs Jonas Hector and Liverpool's Emre Can provided width, central midfielders Toni Kroos and Manchester United's Bastian Schweinsteiger kept the ball moving constantly, while the front four - Muller, Gundogan, Mesut Ozil and Mario Gotze - passed and moved until their opponents were tied up in knots.
Their sharpness and slickness kept the Scottish defence permanently on its toes and, but for a handful of good stops from Marshall, the damage might have been greater.
Man of the match - Thomas Muller
Thomas Muller was once again the principal thorn in Scotland's side, drifting in off the right to score twice, just as he did in Dortmund a year ago.
His ability to be in the right place at the right time is the mark of his genius.
Although his first goal took a fortuitous nick off Russell Martin, Muller was lurking to head his second in off the post after Marshall had made a save to deny Can, with Charlie Mulgrew only able to hack clear after the ball had crossed the line.
And Muller turned creator for the winner, returning a crisp pass for Gundogan to fire in off the post.
- 8BrownSubstituted forMartinat 81'minutes
- 10ForrestSubstituted forRitchieat 81'minutes
- 7MorrisonBooked at 55mins
- 15MaloneyBooked at 58minsSubstituted forAnyaat 60'minutes
- 8ÖzilSubstituted forKramerat 90+2'minutes
- 19GötzeSubstituted forSchürrleat 86'minutes
- 22ter Stegen
- Björn Kuipers
- Shots on Target
Second Half ends, Scotland 2, Germany 3.
Corner, Scotland. Conceded by Jerome Boateng.
Substitution, Germany. Christoph Kramer replaces Mesut Özil.
Jerome Boateng (Germany) wins a free kick in the defensive half.
Foul by Chris Martin (Scotland).
Emre Can (Germany) wins a free kick in the defensive half.
Foul by Chris Martin (Scotland).
Foul by Jerome Boateng (Germany).
Chris Martin (Scotland) wins a free kick in the attacking half.
Substitution, Germany. André Schürrle replaces Mario Götze.
Attempt missed. Mario Götze (Germany) right footed shot from the centre of the box is high and wide to the right. Assisted by Ilkay Gündogan.
Attempt saved. Ilkay Gündogan (Germany) right footed shot from outside the box is saved in the top centre of the goal. Assisted by Mario Götze.
Offside, Scotland. Matt Ritchie tries a through ball, but Steven Fletcher is caught offside.
Substitution, Scotland. Matt Ritchie replaces James Forrest.
Substitution, Scotland. Chris Martin replaces Scott Brown.
Attempt blocked. Toni Kroos (Germany) right footed shot from outside the box is blocked. Assisted by Ilkay Gündogan.
Attempt blocked. Charlie Mulgrew (Scotland) left footed shot from outside the box is blocked.
Foul by Toni Kroos (Germany).
Alan Hutton (Scotland) wins a free kick in the attacking half.