With Puerto Rico clinging to a 1-0 lead in the seventh inning, Mike Aviles led off the frame with a single against Atsushi Nohmi and Rios followed by blasting a pitch into the left-field stands of San Francisco's AT&T Park.
Aviles also drove in a run with a first-inning single for Puerto Rico, which eliminated two-time defending champion Japan and moved on to Tuesday's WBC title game against the winner of Monday's semifinal between the Netherlands and the Dominican Republic.
Mario Santiago (1-0) earned the victory with 4 1/3 scoreless innings, yielding a pair of hits and a walk while striking out two.
Fernando Cabrera recorded the final two outs to collect the save.
Japanese starter Kenta Maeda (0-1) was tagged with the loss despite surrendering just one run on four hits over five frames.
Hirokazu Ibata got Japan's only RBI.
Couple calls 9-1-1 over missing hash browns; assault McDonanld's employees
Obama 'selfie' photographer speaks out: 'Photos can lie'