Adam Szalai's first-half goal was the difference as Hungary came away with all three points in Leipzig on a frustrating night for the German team, who lost for the first time under Hansi Flick.
In a top-of-the-group clash, surprise leaders Hungary managed to secure an impressive away win to retain their top spot and stay in pole position to qualify for the Nations League semifinals.
Germany, on the other hand, are now third behind Italy and can no longer go through. The defeat is the four-time World Champions' first since Hansi Flick replaced Joachim Löw as head coach last year and saw a winless streak of 13 games come to an end.
In a first half with very few opportunities, former Bundesliga striker Adam Szalai broke the deadlock for the visitors with 17 minutes on the clock, flicking the ball into the net with his heel after a corner from Dominik Szoboszlai.
Hansi Flick's troops dominated possession, but struggled to break down an organized Hungary side. Their best chance of the first half fell to Thomas Müller, who was captaining the side in the absence of COVID-hit Manuel Neuer, but the Bayern attacker could only direct his header straight into the arms of Peter Gulacsi with 39 minutes played.
Germany started with more intensity after the break and quickly tested Gulacsi, who did well to save a powerful left-footed shot from Leroy Sané after 51 minutes. A few minutes later, Thomas Müller actually managed to put the ball into the net, but his effort was ruled out for offside.
As the second half progressed, Hansi Flick was forced to push more men forward in search for an equaliser. This allowed Hungary to create a couple of clear-cut chances at the other end, but none of the teams managed to get on the scoresheet in the second half.
Sitting four points behind Hungary with just one game left to play, Germany are now out of the race for an UEFA Nations League semifinal spot, but will have the chance to redeem themselves against old foes England on Monday.
More about the match
Müller: "A lot of us are having a tough time in club football right now, and we didn’t play as well as we can"