TOKYO — Now it’s Tokyo’s turn to be the third wheel.

As recently as last fall, it was Seoul that appeared sidelined by Washington in its approach to North Korea, as President Trump made fiery threats and accused South Korea of “appeasement” for advocating dialogue. Shinzo Abe, Japan’s prime minister, was Mr. Trump’s closest friend among world leaders.

But now Japan, which has hewed closely to the hard-line American posture toward North Korea, is scrambling to remain diplomatically relevant as Mr. Trump moderates his tone in preparation for a possible meeting with the North’s leader, Kim Jong-un, and South Korea takes the lead in brokering talks.

On Tuesday, four days after Mr. Trump stunned the world by accepting an invitation to meet Mr. Kim personally to discuss North Korea’s nuclear program, one of the South Korean envoys who delivered that invitation met with Mr. Abe in Tokyo.

The optics of the meeting — with Mr. Abe asking Suh Hoon, South Korea’s national intelligence service chief, to brief him on the exchange of messages between Mr. Trump and Mr. Kim — made the Japanese leader look a little like a forgotten friend asking for details of a party he missed over the weekend.