It was only the second-ever meeting between the two sides, the Brave Blossoms having recorded one of the biggest World Cup upsets of all time with victory over the Springboks in Brighton four years ago.
There was no repeat on this occasion though, with South Africa taking control from the start as Cheslin Kolbe crossed after just eight minutes.
Fellow winger Mapimpi had added two more by half-time, with Handre Pollard slotting two conversions and a penalty as the visitors led 22-0 at the break.
Mapimpi then completed his hat-trick on 52 minutes, although Japan got on the board on the hour through Kotaro Matsushima.
It was South Africa who finished the stronger though, with a second try from Kolbe followed by a last-gasp effort from Herschel Jantjies, his fourth try in as many Springbok appearances.
The success extends South Africa’s impressive form in 2019 under Rassie Erasmus, having won every game bar one draw away to New Zealand.
The Springboks will take on the All Blacks in their opening World Cup encounter in Yokohama, with Namibia, Italy and Canada also in the group.