Raymond scored on a beautiful individual effort at 11:38 to make it 5-2.
Dalibor Dvorsky cut it to 5-3 with 39 seconds remaining.
Joel Eriksson Ek gave Sweden a 1-0 lead with a short-handed goal at 7:17 of the first period. He broke up a play inside his own blue line and created a 2-on-1 the other way before passing to Kempe. Hlavaj stopped the initial shot, but Eriksson Ek crashed the net and jammed home the rebound.
Slafkovsky tied it 1-1 at 8:59 with his third goal in as many games. A four-pass sequence around the offensive zone ended when Simon Nemec passed to Slafkovsky by the side boards to the right of the goalie. The one-timer beat Markstrom clean.
The Montreal Canadiens forward was taken No. 1 in the 2022 NHL Draft; Nemec, a defenseman, was selected No. 2 by the New Jersey Devils.
Kempe made it 2-1 on a power play at 7:06 of the second when he hammered home a slap shot five seconds after Slovakia’s Pavol Regenda took a penalty for kneeing.
Martin Gernat tied it 2-2 for Slovakia at 9:48, pouncing on a rebound before Markstrom could recover.