Japan scored twice in the eighth and once in the ninth to erase Taiwan leads before getting Matsuda home on a rally that involved a single, a walk and two sacrifices.
Japan, the two-time defending WBC champion, draws the Netherlands in a game Sunday. Taiwan must meet Cuba, one of the pre-tournament favorites, Saturday in an elimination game. The Netherlands opened second-round play with a 6-2 win over Cuba earlier Friday.
Kazuhisa Makita (1-0) pitched a one-hit, one walk (intentional) ninth for the win and Toshiya Sugiuchi, despite two Taiwan 10th-inning singles, got the save. Chen Hung-Wen (0-1) was charged with the ninth-inning runs in the loss.
Taiwan starting pitcher Wang Chien-Ming allowed six hits and walked one through six innings and was pulled with a 2-0 lead.
Hirokazu Ibata and Seiichi Uchikawa started the Japanese comeback with singles in the eighth. Ibata scored on a single from Shinnosuke Abe. After a force at third on a bunt, Hayato Sakamoto grounded a single to left that tied the score.
Taiwan used three consecutive hits for a 3-2 lead with no outs in the bottom of the eighth but didn't manage another run.
Takashi Toritani walked in the Japan ninth and, with two outs, stole second. That left him in position to score on Ibata's line-drive single to center.
Ryoji Aikawa opened the 10th with a single and Yoshio Itoi walked, with Matsuda replacing Aikawa. Sakamoto sacrificed the runners up and Nakata lifted a fly to deep left that drove in the winning run.