Having been drawn in groups which make them considerable outsiders to qualify for the last 16, both the Samurai Blue and Maple Leafs were keen to end their warm-up for the tournament with a morale-boosting success on Thursday.
Up until the closing seconds, it appeared that they would each had to be content with a share of the spoils with Steven Vitoria's close-range effort cancelling out an early strike from Yuki Soma.
However, Canada dramatically secured the win in the final seconds of the game through an audacious Paneka penalty kick from Lucas Cavallini.
The goal which put Japan in front was a piece of brilliance, Nagoya Grampus man Soma latching onto a perfectly-flighted pass over the top of the defence to flick a volley past the advancing goalkeeper.
Soma has only returned to the international stage this year after a three-year absence, but he now has four goals from eight outings for his country.
Canada's equaliser came from a set piece, with an outswinging corner being volleyed on to Vitoria who was waiting to convert at the back post.
As expected, both Hajime Moriyasu and John Herdman used the game to give minutes to as many players as possible, each making a total of six substitutions.
In a bid to protect the fitness of their players, all but one of those alterations were made by the 71st minute, and it was Canada's final switch which contributed to their winner in the fifth minute of added-on time.
After Richie Laryea was hauled down into the penalty area, Cavallini's paneka effort paid off, but only after goalkeeper Shuichi Gonda had failed to get a strong-enough hand to the ball to keep it out.
Japan will now move on to their Group E opener with Germany, which is due to take place on November 23.
Meanwhile, Canada start preparations for their Group F with Belgium, due to be held later on the same day.