Colorado Avalanche forward Matt Duchene had a pair of goals. Steven Stamkos of the Tampa Bay Lightning scored the go-ahead goal in the second period.
Edmonton Oilers goaltender Devan Dubnyk made 24 saves in the win. His Oiler teammate Jordan Eberle assisted on both Duchene goals in front of 5,577 at the Globe Arena.
Those four players have a combined 10 previous world championship appearances between them.
With just three days of practice as a team and 10 Canadians making their world championship debuts Saturday, their composure and patience was the difference in overcoming the tenacious Danes.
"I think the guys who have been in the tournament know how bad teams want to win and especially win when they play against Canada," Canadian head coach Lindy Ruff said. "I think the guys who have played here before, it was one of their better showings."
Captain Morten Green scored a power-play goal to put Denmark up 1-0 after the first period. Goalie Simon Nielsen had 33 saves on 37 shots.
Phoenix Coyotes goaltender Mike Smith will get the start Sunday against Switzerland and the first of his career for Canada. The Swiss, coached by Canadian Sean Simpson, upset host Sweden to open the tournament.
The Swedes recovered to beat the Czech Republic 2-1 on Saturday, while Norway downed Slovenia 3-1 in that group. The United States defeated Austria 5-3 and Russia blanked Latvia 6-0 in Helsinki.
Canada last won a world title in 2007. Since taking the silver medal in 2009, Canada has suffered three straight quarter-final exits.
The players on this year's squad played their final games of the NHL's regular season a week ago and arrived in Stockholm on Wednesday.
The NHL regular season ended three weeks later because of the lockout, so there was no time for Canada to have a proper training camp or exhibition games.
Duchene had spoken the previous day of how difficult it is for North Americans to adjust quickly to the wider international ice, while their European opponents are in their element on it. That was compounded Saturday by the Canadians' unfamiliarity with each other.
But Duchene, 22, and Stamkos, 23, are both playing in their third men's world championship. They've learned how to turn the extra space into scoring opportunities.
They both held onto the puck an extra second to score second-period goals from close range.
"In the NHL, probably both our goals we would have had somebody come down on us there and knock the puck off our sticks, but you have a little bit more room," Duchene said.
"It didn't feel as foreign to me as it usually does. I kind of knew how much time I was going to have today and if you bring speed as a team to that amount of space, you're going to do well offensively."
Dubnyk has been on three previous world championship rosters, but Saturday's start on his 27th birthday was only the fourth game of his career.
With his teammates scrambling to get their act together, Dubnyk bailed them out in the first period by stopping Morten Madsen on a short-handed, odd-man rush with less than a minute to go.
"Usually it's tough enough with two exhibition games to get adjusted to the big ice and the angles and the way the game is played for everybody, but jumping into it with no exhibition games, you have to expect that things aren't going to click in the first period," Dubnyk said.
"When they get one early, every play is important at that point just to keep it a close game."
Denmark is ranked No. 12 in the world behind Canada at No. 5.
Phoenix Coyotes forward Mikkel Boedker and Philadelphia Flyers defenceman Oliver Lauridsen are Denmark's only two NHL players, so most of their national team was together for pre-tournament games.
Denmark forced Canada outside and lifted the Canadians' sticks on scoring chances in the first period. The Danes lost their composure in the second period when Canada's offence began imposing its will below the faceoff circles.
Stamkos converted one of Canada's four man-advantages in the middle period. He's playing right wing for Canada instead of his usual centre.
The two-time winner of the NHL's Maurice Richard Trophy scored a diving power-play goal at 11:38. Stamkos cut across the net's face and swept the puck past Nielsen as the Danish goaltender poked the Canadian's legs out from under him.
"You have some more time when you get in the slot. It's obviously a bigger rink," Stamkos said.
"I thought we did a great job of not panicking. They scored first and had some momentum and we're down after one, but we didn't panic."
Seconds after a Canadian power-play expired, Duchene circled from behind the net and waited for a screened backhand shot at 10:15 to make it 1-1.
He weaved past defenceman Daniel Nielsen and scored his second of the game on a give-and-go with Eberle at 7:03 of the third.
It was the first meeting between Canada and Denmark since 2006 and their fourth in world championships dating back to Canada's 47-0 win over the Danes in 1949. That was the most lopsided score in world championship history.
Notes: Eberle, 22, played in his 20th world championship game for Canada . . . Dubnyk is the first Canadian goaltender to play in four world championships since NHL players started participating in 1977. Roberto Luongo and Fred Brathwaite played in three . . . Defencemen T.J. Brodie, Brenden Dillon and Justin Schultz and forward Matt Read made their international debuts for Canada on Saturday . . . Goaltender Mike Smith, defencemen Brian Campbell and Jay Harrison and forwards Giroux, Taylor Hall and Wayne Simmonds are playing in their first world championship for Canada.Suggest a correction