Federer, a two-time winner at the indoor hard court tournament, had taken a two-week break after losing a grueling five-set semifinal to Andy Murray at the Australian Open.
Zemlja started out strongly, dropping only one point on his first two service games and forcing two break points on Federer's serve in the fourth game.
But Federer switched gears on the 64th-ranked Zemlja, saving both break points. He broke in the next game and again in the ninth game to take the opening set.
The second set was brief, with Federer closing out the match in 58 minutes. Federer conceded it took a while to hit his stride at the indoor Ahoy arena.
"Hall play is different. It's warmer, so the ball flies more and it takes a bit of getting used to," he said. "The first ones are never easy. But I'm happy to be back and playing well."
Also Wednesday, Gilles Simon beat Italian qualifier Matteo Viola 6-3, 6-1 to secure a place in the quarterfinals, and fellow Frenchman Julien Benneteau joined him after a 6-1, 6-3 win over Victor Hanescu.