Vacherot, a 26-year-old qualifier from Monaco, beat Djokovic 6-3, 6-4 to deny him a record-extending fifth title in Shanghai.
He will next face his cousin Rinderknech, the unseeded Frenchman, who came from a set down to oust Daniil Medvedev 4-6, 6-2, 6-4.
"I'm trying to pinch myself, is this real?" said Vacherot after the biggest win of his career.
"I have a hundred feelings right now."
Vacherot is the lowest-ranked player to reach an ATP Masters 1000 final since the format's introduction in 1990.
Djokovic, 38, struggled physically throughout the match, throwing up courtside and receiving medical treatment multiple times.
The former world number one said Vacherot's unlikely run in the tournament was "an amazing story".
"I told him at the net that he's had an amazing tournament, but more so his attitude is very good... so it's all about him," said Djokovic.
"The better player won today."
Health issues
Djokovic declined to answer questions about his physical state.
He had said after his last match that he was concerned after battling vomiting bouts, leg injury scares and fatigue throughout the tournament.
However, he looked alert and seemed to be having a dream start when he broke in the first game.
But the satisfaction was short-lived as Vacherot broke back instantly.
The Serb began having issues in his left leg at the start of the seventh game, stopping to stretch multiple times and dropping to the ground at one point.
He had to take an extended medical break, lying on his stomach shirtless as a physio attended to his back.
With Djokovic clearly unable to move normally, Vacherot had an easy time breaking again in the eighth game, then fired two aces to hold the ninth and claim the set.
Djokovic received treatment again at the break, but was clearly still struggling in the second set.
In temperatures of 31 degrees Celsius and humidity levels of 62 per cent, Djokovic managed to hold the first game despite facing break point twice and falling to the ground again.
Serving in the ninth game, he hit two double-faults in quick succession before recovering, only to ultimately be broken upon committing another.
Despite a last-gasp effort from Djokovic, Vacherot held serve and his nerve to seal victory.
Medvedev out
Rinderknech had a tougher path to the final, battling past Medvedev, another former world number one.
The Russian broke in the third game, and saved a breakpoint in the eighth to take the first set.
The 54th-ranked Rinderknech came out fighting in the second, breaking in the second game and then saving five breakpoints in the almost 17-minute third game.
Medvedev kept pushing, forcing the Frenchman to save another in an 11-minute fifth game.
But Rinderknech broke again in the eighth game to confirm the match would go to a decider.
The Frenchman had another close call in the seventh game of the third set, coming back from the brink twice, both times with an ace.
And in the end, Medvedev, facing match point, hit a double-fault to hand over victory.
Rinderknech dropped to the ground in disbelief and performed a somersault as his cousin rushed onto the court to hug him.
"I guess we must be good people to deserve something like this," he said.
"Deep down in our heart, in our family, we're probably nice people and doing good things, so we probably deserve this... because it's unbelievable, I can't really believe it."
Asked who the crowd should root for on Sunday, he said: "It doesn't matter anymore... You root for him, you root for me... We already won here today."