Down 19-0 early in the second half, the Canadian men reeled off 22 straight points to secure the win.
"It showed a lot of character," said Canadian coach Geraint John. "The players at halftime were composed. Everybody was composed. We knew what we had to do and they executed.
"That's what I liked about the whole weekend. When we executed I thought we were a very very good side and we showed that we deserved to be in that top bracket. Now the hardest part is we've got to continue and move on from here."
Canada stood 13th in the standings after the first three stops on the nine-event HSBC Sevens World Series. But it showed grit throughout the three-day tournament at Sam Boyd Stadium, staging one rally after another, and moved up to 11th spot.
It marked the first time since 2000 and only the second time in IRB Sevens play that Canada had reached the semifinals of the top-tier Cup competition.
South Africa, appearing in its third straight final, beat New Zealand 14-7 to win its second tournament. The Springboks downed the All Blacks 17-14 last time out in Port Elizabeth, South Africa.
The victory moved South Africa ahead of New Zealand atop the series standings.
England held on to edge Australia 26-24 in the consolation Plate final and place fifth. Fiji finished ninth in thumping Kenya 35-0 in the Bowl final and the host U.S. blanked Spain 31-0 to win the Shield and finish 13th.
Going into the third-place game, Samoa had gone 31-3 against Canada in past matches. And the Pacific Islanders were rampant early on as Fomai Ah Ki scored two tries to give the two-time tournament champions a 12-0 lead at the half.
Reupena Levasa scored soon after the restart to extend the Samoan lead to 19-0. Then the Canadian comeback began.
Conor Trainor's try cut the deficit to 19-7 before captain John Moonlight bulled his way over the goal-line to make it 19-14.
Mack then crossed the line in the corner only to see his conversion attempt hit the post, leaving it knotted at 19-19 with 30 seconds remaining. Mack completed the comeback, slotting his drop goal through the posts after Samoa was penalized some 20 metres in front of its posts as time ran out.
Mack finished with 12 points on a try, penalty and two conversions.
"Once we got that roll going in the beginning of the second half, I don't think there was really any stopping us," said John.
The fine Canadian showing came despite a string of injuries that kept captain Nathan Hirayama, Sean Duke, Ciaran Hearn, Mike Fuailefau, Lucas Hammond, Adam Kleeberger and Pat Parfrey out of the lineup.
Canada opened the day with a 26-7 loss to New Zealand in the Cup semifinal.
The semifinal against New Zealand was a tough ask for Canada. The All Blacks' career record against Canada was 23-0 going into the game, with New Zealand outscoring the Canadians 726-151.
Canada got a break with suspensions to New Zealand's George Tilsley (one match) and Sam Dickson (eight) for foul play in its last pool match against Fiji.
The underdog Canadians opened the scoring against New Zealand with a converted Mack try after an attack by Moonlight. But the All Blacks, capitalizing on Canadian defensive mistakes, responded with a try by Scott Curry before Bryce Heem scored on the stroke of halftime for a 2-7 lead.
New Zealand continued to dominate possession in the second half and the Canadians found themselves on the back foot after Australian referee Matt O'Brien called a string of penalties at the breakdown.
Tim Mikkelson and Heem added New Zealand tries to make the final score 26-7, with Gillies Kaka adding three conversions.
"They're a good team," New Zealand coach Gordon Tietjens said of Canada. "A tough semifinal."
On Saturday, Canada rallied from 14-0 down to beat France 17-14 in the Cup quarter-final after recovering from a 12-0 deficit to defeat Wales 21-19. On Friday, Canada downed Kenya 17-15 and lost to South Africa 29-0.
A Canadian women's development side called the Maple Leafs defeated the Aptoella Angels 17-5 to win the companion Las Vegas Invitational tournament.