He gave the Swiss the early ascendancy with a 6-4, 6-2 win against Zverev, before Kerber squared the tie by beating a dogged Belinda Bencic 6-4, 7-6 (8-6) to set up the mixed-doubles decider.
On Thursday, the Greek Team was opposed to Team Switzerland in the Hopman Cup in Perth.
Federer first won the Hopman Cup back in 2001 against the USA when he was paired win Martina Hingis, he then claimed his second title alongside Bencic a year ago also against Germany.
Maria Sakkari could not resist the fan side of her when she was up against Roger Federer at the Hopman Cup.
Federer's performance-level was "the ideal preparation for the Australian Open", according to CNN, and the 20-time Grand Slam champion himself described "the whole match and the whole week" as one giant "thrill".
"If I'm being really frank, I just feel like I had like the worst attitude today", the 21-year-old Osaka said.
The 31st edition of the mixed-teams tournament has been its best one, featuring record crowds and attracting worldwide interest when Serena Williams played mixed doubles against Roger Federer.
Federer said the win helped atone for a loss to the German in the semi-finals of the season-ending ATP World Tour event in London.
Golden Globes 2019: Arab designers dress up the stars
Check out our full Golden Globes coverage for the latest news, fashion and more. "I'm just happy our show happened when it did". Mahersala Ali won for his supporting role in the film " Green Book " and the film also won the best screenplay prize.
Zverev had a glimmer of hope in the first game of the second set, 0-30, and two deuces, but the Federer serving was just too good.
A new ATP World Team Cup tournament is set to be introduced in Australia next year.
Kerber, who earlier this week beat Garbine Muguruza and Alize Cornet, broke twice - but also saved four break points in the second set to beat an error-prone Barty. "It will be tough to swallow because I will remember this as our last ever match", he said.
Kerber managed with a 6:4, 7:6 (8:6) how twelve months ago the balance in the duel with Bencic, who is now number 18 in the world rankings.
Switzerland won the third-set tiebreaker in the mixed doubles after Zverev hit the ball into the net on the winner-takes-all point.
Federer had beaten Frances Tiafoe, Stefanos Tsitsipas, Cameron Norrie and Zverev in straight sets and will be full of confidence heading into Melbourne Park later this month.
"I will be excited to watch it tomorrow and see who we play in the final", Federer said. "Obviously it would be heartbreaking", she said.