The Serbian struggled physically in his final group match against Daniil Medvedev on Friday but went into the semi-finals as the only unbeaten singles player and battled to victory over American Fritz.
Djokovic looked uncomfortable at times but stepped up when it mattered, threading a forehand down the line to take the opening set and then fighting back from 5-3 down in the second.
The 35-year-old won four successive titles between 2012 and 2015 to close to within one of his great rival Federer but has not managed to lift the trophy since.
Fritz was frustrated by a spectator shouting during points, saying: "You get used to playing in absolute silence your whole career. It's normal that the crowd maybe makes a noise when there's a crazy point going on.
"You expect it, you're ready for it. But someone just flat-out screaming to purposely try to throw you off, it's not something you're ever used to. When it happens, it's an absolute shock. It's disgusting."
Djokovic said: "I knew coming into the match that I will not be freshest but that I will have to find a way differently to adjust my game.
"I wasn't game-wise feeling the best. Physically I was OK. I was not hitting the ball cleanly as I have throughout the week.
"At the same time I think that these kind of wins double in value because you're not feeling great but you still manage to win against a great player, two tie-breakers. Of course, I have to be pleased with that."
In the doubles, Joe Salisbury again got the better of his Davis Cup team-mate Neal Skupski as he and American Rajeev Ram reached the final for the second successive year.
Salisbury and Ram defeated Skupski and Dutchman Wesley Koolhof in the US Open final and repeated the feat with a 7-6 (7) 6-4 victory over the top seeds on Saturday.
Salisbury, who is aiming to become the first British player to win the doubles title at the prestigious event, said: "We are very happy to be through. I feel we are pretty good at handling whatever, any situation we are in."
Salisbury and Ram were beaten by French duo Nicolas Mahut and Pierre-Hugues Herbert 12 months ago.