But Cuba, defeated by Japan in the first round, turned the match around as Yurisbel Gracial hit a two-run homer in the second inning.
The two teams progressed fairly evenly in the seesaw match, but Japan finally took the lead as substitute Seiichi Uchikawa scored the decisive run with a sacrifice fly in the bottom half of the eighth inning.
Yamada silenced the Cubans by smashing his second homer of the game in the same inning before ace closer Kazuhisa Makita sealed victory in style.
"It was good to have my own swings," upbeat Yamada told reporters.
"We are aiming at the world number one, but first we will beat our opponents at hand," Yamada said.
Japan manager Hiroki Kokubo said: "It was a tough game today, but our batters held on. What happened so far today is a thing of the past. We will go for a victory tomorrow at any cost."
Japan will take on Israel on Wednesday, while Cuba will play the Netherlands.
Japan, chasing a third title after scooping the first two editions of the World Baseball Classic in 2006 and 2009, narrowly beat the Netherlands on Sunday in their second round opener.