Finland led 3-0 after two periods but blew the game open with five goals in third. Salomaki and Pokka scored in the first five minutes, and then Barkov, Pokka and Armia scored in a 2:30 span in the game's final minutes.
In the other relegation-pool game, Andrej Bires' second goal of the game helped Slovakia hold off Latvia for a 4-3 victory.
Slovakia led 3-1 after two periods, but Latvia got an early third-period goal from Nikita Jevpalovs and a goal midway through the period from Edgars Kulda to tie the game.
With 5:25 left in regulation, Bires scored to win it for Slovakia, which next plays Finland on Friday. Germany and Latvia also will play Friday, in the relegation-round finale.
Contact Adam Kimelman at email@example.com. Follow him on Twitter: @NHLAdamK