Fiji has scored five tries in a 20-minute spell on either side of halftime, then held on to beat Japan 33-27 in the final of the Pacific Nations Cup.