The world No.1 scored a tense 6-7 (3-7) 6-2 7-5 victory over Alexander Zverev in their singles rubber, levelling the match after Jan-Lennard Struff beat Dusan Lajovic in three sets.
Zverev and Struff then teamed up in doubles to net a 7-6 (7-4) 5-7 10-7 win over Djokovic and Nikola Cacic.
The singles workout and win sets up the eight-time Australian Open champion well for the start of that grand slam next week, which was the consolation Djokovic could take from defeat.
Speaking about his singles clash with Zverev, Djokovic said: "It was anybody's game really. He was a set up, a couple points here and there in the beginning of the second. I just returned well when I needed to and closed out the match.
"It's never easy playing against Sascha [Zverev] when he's in form, and he's in really good form. We pushed each other to the very limit, and I'm glad that I had such a battle with him.
"It's unfortunate we lost the tie. That's what this competition is all about. It's about the team, not about winning one match, a singles match. Yeah, it's a tough one."
Germany advances to face Russia in the semi-finals on Saturday, with Daniil Medvedev and Andrey Rublev a formidable combination in wait.
Spain secured a shot at Italy in the second semi-final, despite a 2-1 defeat to Greece on Friday.
The Spanish team needed just one win in the group-stage match to advance, and that predictably came as Pablo Carreno Busta, ranked No.16 by the ATP, beat world No.462 Michail Pervolarakis.
His 6-3 6-4 success could not be matched by team-mate Roberto Bautista Agut, who fell to a 7-5 7-5 defeat against Stefanos Tsitsipas, while Spain retired from the doubles rubber after one game, giving Greece a 2-1 success in the tie.
It remains to be seen whether Rafael Nadal will be fit to play any part in the semi-final, with the 20-time grand slam champion having been absent so far in the campaign because of a back injury.
"He's working very hard to recover his best feelings," Spain captain Pepe Vendrell said.
"Obviously he couldn't play any matches during the week. It's a situation that we have to study. But day by day he's improving. We will see [on Saturday] if he can play."
AWAY FROM THE ATP CUP, WAWRINKA ABANDONS
In the Murray River Open, Stan Wawrinka withdrew from his quarter-final with Jeremy Chardy after beating Australian Alex Bolt in a tough three-set match earlier in the day. Corentin Moutet, Dan Evans and Felix Auger-Aliassime joined Chardy in the last-four line-up.
Evans defeated Borna Coric, who had eliminated Australian hope Nick Kyrgios in his previous match.
All ATP and WTA tournaments are being played at Melbourne Park this week.
Thursday's play was cancelled because of a COVID-19 case affecting a worker from a hotel that accommodated quarantining players, and that meant Friday's schedule was packed.
The Great Ocean Road Open also saw players needing to win two matches in a day to reach the semi-finals, with Karen Khachanov, Thiago Monteiro and the Italian pair of Jannik Sinner and Stefano Travaglia coming through.