Having trailed 16-0, the Samoans then scored 27 unanswered points, before having to withstand a tremendous fight back by the hosts.
Two late tries saw Japan close to within a point but Ryan Nicholas' conversion of Toshiaki Hirose's try drifted right, much to the disappointment of the large majority of the 5,386 in attendance.
"Japan played very well and forced us into making mistakes. They sure gave us a good fight," said Samoa coach Stephen Betham.
The Scots arrived in Samoa buoyed by a win over Fiji last weekend that included two tries from new cap Tim Visser. Their victory in Lautoka made it two out of two on tour following their 9-6 win over the Wallabies.
A third successive away win would once again improve their IRB World Ranking and make it a wonderful summer for former British & Irish Lions forwards coach Andy Robinson.