NEW YORK — Juan Martin del Potro and Janko Tipsarevic found themselves on a practice court together at Wimbledon, though they spent more time talking than hitting the ball.

They swapped tales of undergoing surgery after surgery, of the anguish of missing so much tennis and wondering if their injuries would ever heal.

“We were basically interrupting each other with what was going on through our minds in this, like moments of depression and sadness, just not seeing the light at the end of the tunnel,” Tipsarevic recalled.

Tuesday was a moment of joy and relief for both men. The two former top-10 players currently ranked in the triple digits each won a U.S. Open match for the first time since 2013.

Since his last appearance at Flushing Meadows three years ago, del Potro needed three left wrist surgeries and contemplated retiring. The 2009 U.S. Open champ went 2½ years between majors before coming back at Wimbledon, where he upset Stan Wawrinka.

Then at the Olympics, del Potro beat Novak Djokovic and Rafael Nadal en route to the silver medal. He returned home to a hero’s welcome in Argentina.

It wasn’t exactly the best way to recharge, though, physically and emotionally.

“To be honest, I’m still feeling tired, for sure,” del Potro said.

Looked just fine against fellow Argentine Diego Schwartzman on Tuesday, when del Potro won 6-4, 6-4, 7-6 (3), urged along by appreciative fans.

Tipsarevic didn’t have the crowd on his side when he faced American Sam Querrey, who upset fellow Serb Djokovic in the third round at Wimbledon.

No matter, Tipsarevic beat the 29th-seeded Querrey 7-6 (4), 6-7 (0), 6-3, 6-3 for his first victory at any major since the 2013 U.S. Open.

He played a few more tournaments that season — then didn’t return to competition for more than two years.

“Even in the first six or seven or eight months, it wasn’t that bad,” he recalled.

Tipsarevic was taking so many painkillers in 2013 because of a bum left foot that they were causing liver problems.

“I was really screwed up,” he said. “So in the beginning it was a little bit of a relief, saying, ‘OK, I’m going to take two, three months off, skip to Australian Open, be hungry, come back.'”

Instead, Tipsarevic first underwent surgery on his foot for a benign tumor in May 2014, and because of complications, he needed a second procedure that September.

With other injuries, a player can at least do some kinds of workouts to ease the mind. But he spent four months mostly confined to bed.

“I even played tennis for a while sitting on a chair because I couldn’t stand,” Tipsarevic said. “I’m not crying you a river here — I’m just telling you how it actually was.”

Not only did he hate tennis then — he hated all sports. He was too jealous of any athlete to take in a game.

“They could run and do what they like, and I’m just sitting at home and watching TV,” he said.

His one solace was his young daughter. Back on court in 2015, Tipsarevic lost seven straight tour-level matches during one stretch, also missing time because of a knee injury. He’s No. 250 in the world now, and the two-time U.S. Open quarterfinalist got in this year with a protected ranking.

For Querrey, it was a tough first-round matchup as he failed to build on the Djokovic win in the next major after Wimbledon, where he made his first Grand Slam quarterfinal. He hurt his back in Toronto, and said “it was just tough to kind of get the motor rolling again.”

Another American, 19th-seeded Steve Johnson, is up next for del Potro. Johnson was down two sets and a break to 79th-ranked Evgeny Donskoy on Tuesday and saved six match points in the third before winning 4-6, 1-6, 7-6 (2), 6-3, 6-3 in 3 hours, 13 minutes.

Before the 142nd-ranked del Potro received a wild card from the U.S. Tennis Association into the tournament, Johnson noted that if that happened, it was possible the Argentine could defeat an American in the first round. Now it’s Johnson meeting del Potro in the second.

He was fuming that he felt his quote was taken out of context — he pointed out he also said del Potro was deserving of the wild card.

Johnson insisted he felt fresh after Tuesday’s five-setter. He’ll need to be Thursday against an opponent who again is eyeing deep runs at majors.

“The worst part of my life is totally in the past,” del Potro said, “and I’m living a good present and looking forward for a good future.”