Djokovic got to serve first in the fifth, giving him a psychological edge as long as he held his serve.
Wawrinka had game point in the 22nd game but let Djokovic get on a roll. He saved his first match point with a service winner, then saved another two minutes later.
At 1:40 a.m. local time, Wawrinka was whacking his head with the racket and biting the ball after giving Djokovic another match point.
Moments later, he was slumped on the court, exhausted. Djokovic raised both arms, walked to the net and embraced his beaten rival, then pulled of his shirt and flexed.
‘‘Give him credit, he made me run all over the court,’’ Djokovic said. ‘‘He never gave me the same ball. He was aggressive from both sides. I didn’t know what was coming next.’’