Juan Soto, Carlos Santana and Amed Rosario homered to build a 6-4 lead.
Yates relieved Collin McHugh to start the ninth and gave up a leadoff single to pinch-hitter Seiji Uebayashi, who stole second. Pinch-hitter Tsubasa Aizawa had a one-out RBI single, and Yanagita homered to center two pitches later before 44,943 at Tokyo Dome.
"No matter how you look at it, it's tough to lose a game like that," MLB manager Don Mattingly said. "You feel like you played well enough to win. ... Other than that last inning, I thought we played well."
Rosario had a solo homer in the third and Santana hit a three-run homer in the fifth for a 4-1 lead, but Shogo Akiyama hit a three-double double off Matt Andriese in the bottom half. Soto hit an opposite field two-run homer to left in the sixth.
"Before the game, we talked about getting off to a good start to build up some confidence for the rest of the series," Akiyama said. "We never felt like we were out of it and knew if we stayed close we'd have a chance to win."
The series continues this weekend with two more games in Tokyo followed by one game in Hiroshima on Tuesday and two games in Nagoya on Wednesday and Thursday.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.