Novak Djokovic into US Open last 16 after five-set thriller
Second seed Djokovic recovered from a sluggish start on the Arthur Ashe Stadium to complete a 4-6, 4-6, 6-1, 6-1, 6-3 victory in 3hr 45min.
The win marked the eighth time in Djokovic's career that he has overturned 0-2 deficit to win in five sets at a Grand Slam tournament.
"I hope you enjoyed the show," Djokovic told fans in an on-court interview after a match that wrapped up at around 1.30am Saturday local time.
"It was definitely not so enjoyable for me, especially in the first two sets. It was one of the toughest games I've played here for many, many years."
Once again, it was the 36-year-old 23-time Grand Slam singles champion's near-superhuman composure under pressure that came to the rescue.
Djere, seeded 32nd in New York, has never been beyond the third round at a Grand Slam tournament, and had fallen in the first round on his last four visits to the US Open.
But the 28-year-old stunned Djokovic in the opening two sets, playing with poise and confidence to open up a 2-0 lead after breaking his compatriot once in each set.
Yet with the match seemingly there for the taking, Djokovic flipped the switch in the third, fourth and fifth sets.
Suddenly, Djere's serve, which had been virtually impregnable in the opening two sets, began to look vulnerable.
Djokovic broke twice in the third before breaking Djere four times in the fourth set to set up a decider.
From there, there was only going to be one winner and Djokovic broke again and had soon sprinted into a 4-1 lead, before serving for the match at 5-3.
Djere stubbornly saved one match point, but Djokovic sealed victory on the next match point when Djere pulled a backhand wide.
Djokovic later revealed he had given himself an angry pep talk in the locker room after falling two sets behind.
"I did a little pep talk in the mirror," he revealed. "I laughed at myself because I was so pissed off with the way I played, to try and lift my spirits up.
"I've done it a few times before in my career and it hasn't worked but tonight it did and I'm grateful."
Djokovic, who is chasing a record-extending 24th Grand Slam title in New York, will now play Croatia's 105th-ranked Borna Gojo on Sunday for a place in the quarter-finals.