Latvia won 4:3 in a shootout after the two sides were level at 3:3 at the end of regular time and overtime.
With two wins from five outings, Latvia's chances of a quarter-final place remain slight, but are still alive. The next outing is against Great Britain on Sunday.
In the first stage of the championship, 16 teams are divided into two groups, and a round-robin tournament is played. The four strongest teams in each group will advance to the quarterfinals. The world champions will be decided on May 29.