Medvedev, who lost all three of his group matches previous year on his tournament debut, has now beaten Djokovic in three of their last four meetings.
After a quick hold, Medvedev came out on top in an 11-minute marathon, bringing up his third break point of the game dealing with a poor Djokovic drop shot.
Another comfortable hold brought the fourth seed to within a game of the set and he watched as Djokovic double-faulted three times, the last on set point to put Medvedev up a set. Medvedev saved the only break point he faced at 2-0 and then secured the victory with a forehand victor on his first match point. "Just not a great match from my side". It was not a good game for me, I should have done much better.
Zverev who stands 28 centimetres taller than Schwartzman, appeared to be in control in the second set but stumbled twice on serve as his 28-year-old opponent levelled the match.
"I'm excited for Friday", said Zverev.
Medvedev was on point as he destroyed Djokovic
The German, who has won two titles in the coronavirus-truncated 2020 season, beat Djokovic in the final in London two years ago but is yet to win a Grand Slam. "I need to win every match, otherwise I'm out, so I've got to go in with that mindset".
Schwartzman broke early in the first set, but like in Monday's loss to Djokovic he immediately gave it back.
Medvedev rolled through his first service game and held 15-40 in Djokovic's service game only to commit a pair of unforced errors, allowing the Serb to escape and lead 2-1.
On Thursday, Rafael Nadal will play Stefanos Tsitsipas with a semifinal place at stake.
Russia's Daniil Medvedev (R) bumps fists with Serbia's Novak Djokovic after winning their men's singles round-robin match on day four of the ATP World Tour Finals at the O2 Arena in London on November 18. The Russian is 0-2 and can't advance.