Eriks Mateiko scored a goal in the third period and buried the game-winning goal in the shootout to help Latvia secure a 3-2 win over Canada at the World Junior Championship.