The result was far more competitive than the last time the two met in this tournament, with the 35-year-old Swiss star breezing to a 6-0, 6-0 triumph in their quarterfinal match in 2013.
Federer, who is bidding for his 16th grass-court title, owns a 56-6 career mark with eight championships in Halle. He advances to face another German in defending champion Florian Mayer, who posted a 6-7 (6), 6-4, 6-3 victory over sixth-seeded Frenchman Lucas Pouille.
Federer has won all seven of his career matches against Mayer, including three straight-sets wins in Halle.
Federer gained the advantage over Zverev in the tiebreak with a pair of backhand passing shots, ultimately leading him to a first-set victory. Federer then benefited from his strong serve, finishing with five aces while converting three of his four break opportunities to end the match in one hour and 30 minutes.
Mayer squandered a 5-3 lead in the opening set before recording the lone break in each of the remaining two sets to win his match in one hour, 47 minutes. The victory enabled him to reach the quarterfinal round in Halle for the seventh time.
Russian Andrey Rublev needed three sets to best countryman Mikhail Youzhny with a 6-0, 3-6, 6-3 victory. The 19-year-old Rublev, who received a wild card for the grass-court tournament, will face another Russian in Karen Khachanov in the next round.
Khachanov advanced after third-seeded Kei Nishikori of Japan retired due to a left hip injury. Khachanov, who was leading 3-2 in the first set when Nishikori withdrew, advanced to his first grass-court quarterfinal.
Nishikori has been plagued by injuries in Halle over the last three years. He withdrew last year before his second-round match versus Mayer and retired in his 2015 semifinal against Andreas Seppi.