Roger Federer also lost the number one spot in ATP rankings to Rafael Nadal, and missed a chance to earn a record 10th title at Halle.
Roger Federer's win over Denis Kudla was his 20th in a row on grass, dating to June, 2017.
Djokovic is through to only his second semi-final of a troubled campaign as he hunts his first title in 2018.
The Swiss is sparing no effort to make sure he lifts a tenth title at the event on Sunday.
World number one Roger Federer kept his quest for a 10th Halle grasscourt title alive by saving two match points to defeat France's Benoit Paire 6-3, 3-6, 7-6 (9/7) and make the quarter-finals on Thursday.
The world number one needs to lift a record 10th title at Halle on Sunday in order to remain at the summit of the rankings and assure himself the top seeding at Wimbledon starting a week from Monday.
In order to stay ahead of rival Rafael Nadal, Roger Federer must now win the Halle trophy
Federer made a return to the top ATP ranking for a sixth time through his semi-final victory on Saturday over Australian Nick Kyrgios.
Roger Federer will play for the 98th title of his career on Sunday against Milos Raonic.
Roger Federer needs to win one more match in Stuttgart to return to the No.1 spot for the second time this season.
Roger Federer was made to battle after a losing first set as the Swiss star made his long-awaited return to tennis
Roger Federer is beginning his grass season in Stuttgart for the third consecutive year after reaching the 2016 semi-finals.
Rafael Nadal insists that he has no desire to become locked into an arms race with Roger Federer to surpass his great rival's 20 Grand Slam titles.
The top seed is the overwhelming favourite to lift a 17th career major at Roland Garros after claiming his 11th titles on clay in both Monte Carlo and Barcelona this spring as well as an eighth trophy in Rome.
The shock result on Friday also means that Roger Federer will reclaim the world number one ranking on Monday
The 31-year-old saw off Nishikori 6-3, 6-2 to become the first man to win a single tournament 11 times in the Open era with his 76th ATP Tour title.
The top seed is bidding for an outright record 31st Masters title this week and extended his run of consecutive sets won on clay to 34.
Rafael Nadal suggested that Roger Federer avoids him on clay after the Swiss skipped the clay-court season for the second successive year.