The Serbian triumphed 5-7 6-2 6-2 6-3 to thwart Berrettini's revenge mission, having defeated the Italian in this year's Wimbledon final.
The world number one now faces the man who denied him a shot at the Golden Slam, with Zverev dumping Djokovic out of the semi-finals at Tokyo 2020.
And the 20-time grand slam winner was full of praise for his next opponent.
"He's in tremendous form, he's been winning a lot," said Djokovic, who still has the Calendar Grand Slam in his sights. "He has comfortably moved to the semi-finals here.
"I know his game well, we played in Tokyo. He's one of the best players in the world, but the bigger the challenge the more glory in overcoming it."
Reflecting on his victory over Berrettini, Djokovic felt he found his best form after dropping the opening set.
"This was a great match, with a lot of energy on and off the court," he said.
"Matteo is a terrific player and every time we face each other it's a close battle.
"When I lost the first set, I managed to forget about it and move on. I was locked in at the start of the second and it was the best three sets I've played so far."