The 2014 US Open runner-up, who has been plagued in recent seasons by injury, turned the tide at the Montreal Masters as he put out the 55th-ranked American teenager who played last month's Newport grass final.
Nishikori, aged 34 and ranked 576, earned a second-round match with eighth seed Stefanos Tsitsipas, a former Grand Slam finalist like his Asian opponent.
"It has been a long time. This means a lot, especially the way I played in the third set," Nishikori said.
"The first two sets were a bit up and down but in the third I was playing pretty good tennis.
"I had good movement when I needed it and I played aggressive. Things were working really well."
Nishikori and Tsitsipas stand 1-1, with their last meeting in 2021 at the Miami Masters.
The winner said that his fitness was not optimal during the match.
"I was not feeling 100% and I didn't have much confidence," Nishikori said. "But when I won the second set I was happy with how I was playing."
Nishikori let go of a 3-1, 40-15 lead in the first set, losing it before starting to turn the tide.
He ended after two and a half hours with four breaks of serve and 30 winners to the 14 of his 19-year-old opponent.
Lorenzo Sonego also advanced at an event that began a day later than usual due to the Paris Olympics. The Italian put out Tallon Griekspoor 7-6 (9/7), 5-7, 6-4.
The Montreal field is headed by world number one Jannik Sinner with former Olympic gold medalist Alexander Zverev seeded second.
Olympic champion Novak Djokovic and silver medalist Carlos Alcaraz were late withdrawals from the Canadian hardcourts.