The 21-year-old German looked to be on the brink of another disappointing early exit from a Grand Slam, with 26th seed Dzumhur serving for the match at 5-4 in the fourth set.
But Zverev held his nerve to force a tie break, which he won comfortably.
Matching Zverev for power and stamina and showing a fine touch, with multiple winning drop shots, Dzumhur took the match to his bigger opponent, pushing the German to his second five-set encounter in a row.
In their only previous meeting, last year in Shenzen, Dzumhur won in straight sets and he showed confidence throughout on Friday, until the closing stages.
Zverev's win, which secures his spot in the fourth round in Paris, was his first against a top 50 player in a Grand Slam.