"It has been a hard year, I have spent a lot of time on practice, training and rehab so it is nice to be back on court", said Federer, who suffered a surprise defeat by Tommy Haas in Stuttgart earlier this month.
Federer, who won the Australian Open in January for his 18th Grand Slam title, made a decision to skip the clay-court season, including the French Open, to prepare for the grass and hard-court seasons, with his eye on Wimbledon, where he is a seven-time champion.
A break of serve which put the Swiss 5-2 ahead in the second set proved crucial and he clinched victory with his first match point courtesy of a typically sumptuous volley into an open court.
But he quickly fell behind in the second as Zverev, a finalist a year ago, who has already won three titles in 2017, charged to a 4-2 lead and held on to take the set.
"It was important to be aggressive off the baseline and make him feel my variation and the power I can bring to the court", Federer said. "I'm still just very happy how I was able to close it out in the breaker".
Federer, an eight-time champion in Halle, had 11 aces, saved both break points he faced and converted two of his own to maintain his bid for a 16th grass-court title. It was quite quick, and usually in doubles the points are a little bit shorter.
The bare numbers hardly tell the tale: 6-1, 6-3 to Federer, 58 points to 33 overall, winning 79% of his service points, 52% when receiving.
In Halle this week, Roger Federer analyzed the current situation his main rivals are going through and their recent results. This was their third meeting and the second win for Roger, who lost to Sascha in the semi-final here 12 months ago.
This is set to be a really interesting match as it is between two players are at two very different stages of their career. He improved his Halle record to 57-6.