Federer had already clinched a record 13th Tour Finals semi-final place after ending Novak Djokovic's three-month, 23-match winning run on Tuesday.
But the 34-year-old Basel native still needed to beat Nishikori to be certain of advancing as the group winner and he finished the job in two hours and ten minutes to secure his third successive victory at the prestigious season-ending event at the O2 Arena.
“It was a really important one for me, to move on (to the semi-finals) with a good feeling,” Federer said.
“There's points on the line and prestige, wanting to beat Kei, winning at the O2,” he said.
“I want to do well here.”
Nishikori said: “Each set I didn't start well. Every time he broke first and I was on the defensive all the time. That was my big mistake.
“In the end it was a really close game, just a couple points that I didn't play quite well enough. It's a shame to lose like that.”
Federer, who has won the Tour Finals a record six times, will face either Andy Murray or Stan Wawrinka in the last four on Saturday.
Murray and Wawrinka clash on Friday to determine the second qualifier from the other group, which has already been won by Rafael Nadal.
The second semi-finalist from Federer's group will be decided later on Thursday when world number one Djokovic plays Tomas Berdych.
Defending champion Djokovic will be through if he wins in two or three sets and he would still qualify if he loses in three sets, with only a straight sets win for Berdych enough to send the Czech in the last four.
Nishikori's last meeting with Federer had also been at the Tour Finals 12 months ago and ended in a heavy defeat for the Japanese star.
This time the 25-year-old put up much more of a fight, but once again he was denied a third career win over the player he grew up idolizing.
Nishikori has struggled with a host of injuries during a disappointing 2015 and, still troubled by fitness issues this week, he could have allowed his season to fizzle out when a wayward backhand gifted Federer a break in the fourth game of the first set.