"Sorry for you fans and Novak because we all know what he was going for," Medvedev said.
"What you have accomplished in your career... for me, you are the greatest tennis player in the history."
Medvedev, the 2019 US Open runner-up, captured his first Grand Slam title in his third Slam final, a rematch of February's Australian Open final, won in straight sets by the 34-year-old Serbian to launch his Slam quest.
"Congratulations to Daniil. Amazing match," Djokovic said. "If there's anyone that deserves a Grand Slam title right now, it's you."
Djokovic's bid to sweep the US, French and Australian Opens and Wimbledon in the same year for the first time since Rod Laver did it 52 years ago collapsed at the last hurdle, with 83-year-old Aussie legend Laver among 23,700 watching at Arthur Ashe Stadium.
"Simply stunning Daniil Medvedev, you stopped one of the greatest tonight," Laver tweeted. "To win your first Grand Slam title is always special, to do it against a champion like Novak Djokovic is something else. Take heart Novak, the quest continues. Best wishes."
Djokovic missed out on his fourth US Open title and will enter 2022 tied with "Big Three" rivals Roger Federer and Rafael Nadal, both absent with injuries, on an all-time record 20 men's Slam titles.
Sitting after the match, tearful Djokovic said he was overcome with emotions.
"Relief," he said. "I was glad it was over because the buildup for this tournament and everything that mentally, emotionally I had to deal with throughout the tournament in the last couple of weeks was just a lot.
"It was a lot to handle. I was just glad that finally the run is over.
"At the same time I felt sadness, disappointment, and also gratitude for the crowd."
Djokovic paid tribute to the crowd that roared support for him even when all seemed lost down two sets and two breaks.
"Even though I have not won the match, my heart is filled with joy and I'm the happiest man alive because you guys have made me feel special on the court," Djokovic said.
"You guys touch my soul. I've never felt like this in New York."
Instead of joining immortals Laver and Don Budge, who completed the first men's Slam in 1938, Djokovic became the third man to fall at the final match attempting to complete the Slam after Australians Jack Crawford in 1933 and Lew Hoad in 1956.
"I do feel sorry for Novak because I cannot imagine what he feels," Medvedev said.
Djokovic saw his 27-match Slam win streak halted three shy of the record he set in 2015 and 2016 when he won four consecutive Slams, ending with the 2016 French Open.
Medvedev, 25, became the third Russian man to win a Grand Slam title after Yevgeny Kafelnikov at the 1996 French Open and 1999 Australian Open and Marat Safin at the 2000 US Open and 2005 Australian Open.
Struggle from the start
In the biggest of Djokovic's 1,176 career matches, he made two unforced forehand errors to surrender a break in the first game and Medvedev held through to take the first set, never facing a break point.
It was the fifth consecutive match in which Djokovic dropped the first set.
Djokovic squandered three break chances in the second game of the second set and another in the fourth, when he smashed his racquet in frustration.
In the fifth game, Djokovic mis-hit a backhand volley to hand Medvedev a break and a 3-2 lead and the Russian held three times to claim the set.
Medvedev broke in the first and third games of the final set, pulled ahead 5-1 and served for the match in the eighth game.
With hecklers in the crowd, Medvedev double faulted on championship point and again, then netted a forehand to surrender a break that kept Djokovic in the match.
"It was not easy," Medvedev said.
Serving again for the match at 5-4, Medvedev double-faulted on his second match point but finally got over the line on his third chance with a service winner after two hours and 16 minutes.