NISHINOMIYA, Japan -- Evan Longoria hit a grand slam and the Major League Baseball All-Stars survived a late rally to beat a split Japan squad 8-7 in an exhibition game on Tuesday ahead of their five-game postseason tour.

The MLB All-Stars scored two runs in the fourth inning and Longoria made it 6-0 with a blast over the center field wall in the fifth inning at Koshien Stadium.

Evan Longoria celebrates his grand slam, which gave the MLB All-Stars a 6-0 lead. AP Photo/Kyodo News

"I was able to get a good pitch and drive it," Longoria said. "We don't know a lot about these guys so you've got to try to come into the game and put the bat on the ball."

Salvador Perez hit a solo homer in the sixth, and Hiroki Uemoto drove in a run in the bottom of the sixth. The All-Stars responded when Dexter Fowler hit a solo shot in the seventh to make it 8-1.

But the hosts rallied, scoring five runs in the seventh and another in the eighth to make it a one-run game.

The Japan team was made up of members of the country's two most popular professional teams, the Yomiuri Giants and Hanshin Tigers.

All-Stars manager John Farrell said he was pleased with the result.

"Tonight was more than we could have asked for," Farrell said. "We were able to get every position player on the field, we were able to go to our bullpen, but their competitiveness forced us to make some plays."

Chris Capuano picked up the win after striking out three and holding Japan to one hit over four scoreless innings.

The five-game series against Japan will start on Wednesday at Kyocera Dome in Osaka. There are also games at Tokyo Dome, Sapporo Dome and Cellular Stadium in Okinawa.

The series marks the first time since 2006 that a MLB All-Star team has visited Japan.