The first two sets brought a vintage performance on a sultry night from Nadal, who has dropped to world number eight in what has been a lacklustre season for the 29-year-old Spaniard.
Given his last chance to keep alive a 10-year streak of winning at least one grand slam title, 14-times major winner Nadal schooled the 18-year-old Coric over the first two sets.
But Coric responded with his best tennis and broke the Spaniard in the 10th game of the third set to send the match to a hard-fought fourth set.
The Spaniard finally prevailed thanks to a service break on a forehand service return winner in the seventh game.
“It’s a very happy moment for me,” said Nadal, returning to Flushing Meadows for the first time since his 2013 U.S. Open triumph after missing last year with a wrist injury.
“Last year was very hard not having chance to being back in one of my favourite tournaments.”
Nadal avenged a 6-2 7-6 loss to Coric last year at Basel in his only previous encounter with the up-and-coming Coric, who at number 33 is the youngest player in the world’s top-50.
“I think I played great. The first two sets I played a very high level of tennis,” said Nadal, who served brilliantly over the first two sets and in the fourth.
“Then I get a little bit tired. I was sweating a lot.
“He is a great player and has an amazing future.”
Coric, who reached the semi-finals this year in Dubai and Nice, leads all teenagers with 22 wins this season on the ATP Tour, nine more than Alexander Zverev of Germany.
“It was the first time in my life on such a big court,” said Coric, who two years ago won the U.S. Open junior title. “I played a solid match, so very good.”
Nadal next meets Diego Schwartzman of Argentina, a 6-3 6-2 6-2 winner over Swedish qualifier Elias Ymer.
(Editing by Sudipto Ganguly)