Steady rain restricted play to the two main show courts to start the day at Flushing Meadows, where Nishikori, the 2014 runner-up, needed five match points to eventually oust 108th-ranked Klahn.
"I knew it was going to be a tough one because he has a great serve and he did today," said Nishikori, who blew a 5-1 cushion in the final set before getting across the finish line.
"A little bit of lost focus. After 5-1, I was serving for the match at 5-2 and he started playing better too. I'm happy to win of course, it was a good match and I'm looking forward to playing the next one."
Nishikori has reached the quarter-finals or better at the last five Grand Slam tournaments and will take on either Chilean 31st seed Cristian Garin or Australia's Alex de Minaur for a spot in the last 16.
"It's always fun to play here in New York. It's really fun on the court and I hope I can keep playing good tennis."