The 20-time Grand Slam champion wasted a match point when he was having a two-set lead and saw Anderson ride the sudden shift in momentum in the marathon last-eight outing that extended to four hours and 14 minutes in Court 1 of the All England Tennis Club.
The path is still open for Federer to face Rafael Nadal in the Wimbledon Men's Singles final if both players win their next two matches. Djokovic broke Nishikori's serve seven times, and finished with six aces.
Defending champion Federer hadn't been broken since the opening set of his 2017 semifinal victory over Tomas Berdych.
When Federer gets up 2-0, you don't think it's going to be a full five sets.
It was a match Federer could, probably should, have won and yet he will now leave here wondering - probably like everyone else - how many more chances he will get to add to his eight Wimbledon titles. But that turned out to be the least of his worries.
Del Potro was the only one of the quarter-finalists in action on Tuesday as he finished off a tough four-set victory over Gilles Simon.
Anderson v Isner will be played at Centre Court, of course, a spot Federer knows well.
But Anderson did not appear to be struggling physically on Wednesday, even when the match went deep into a fifth set.
Federer, 36, breezed through the opening set in just 26 minutes, had a match point in the third set and was just two points from victory a couple of times in the epic fifth set that lasted 90 minutes.
Anderson traded with a defensive Federer as they rallied to enter sudden death.
"In the last set there was a little of everything, great points, great rallies, he was hitting insane with his forehands".
Serving at 5-6, Anderson fell behind Love-30, which put Federer two points form defeat.
But this time Federer cracked, serving his first double fault at 11-11 in the decider to give Anderson the crucial break that ushered the Swiss to the exit door.
He is also the first Japanese man to reach the quarter-finals since Shuzo Matsuoka in 1995.
"It feels great to be in the last four of a slam", Djokovic said on the BBC.
"I just kept on telling myself I have to continue believing". "By the end, I thought I did a great job of not thinking about things too much". Beating Roger Federer will be one to remember, certainly in such a close match.
This will be their first meeting on grass, and Nishikori said: 'I think it's going to be a new game for us. That's the mindset you need against someone like Roger.
"Anything could have happened, so this is a big achievement for me to get to the semi-finals at Wimbledon".
After a slump following two years of nearly total domination of the men's game, Djokovic's star appears to be back on the rise and he is a clear contender to win a fourth Wimbledon title.
Later in the match, Djokovic was clearly frustrated and complained of "double standards" when Nishikori was not punished for a racket throw.
"I wouldn't call it unfinished business", he said.
"I think I had my chances, so it's disappointing".
"I wouldn't necessarily say I've been playing like incredible". Kei did the same in the fourth set but wasn't warned.
"I'm not sure. That could have been a key".
Anderson, however, took one of the two offered his way, enough to win the set 7-5, stunning the audience as well as commentators who hadn't seen this coming. "But hopefully I have two more matches to play". "I don't think it would have changed if I played there previous year".