Sochi silver medallist Sven Kramer of the Netherlands, one of the favourites for gold, finished sixth.
Bloemen, the world record holder, faced a daunting task as Bergsma, who raced in the pair before him, shaved 2.46 seconds of the Olympic record he set in Sochi.
But the Canadian displayed nerves of steel, producing a tremendous effort to beat the Dutchman by 2.22 seconds.
Bloemen, who was born and raised in the Netherlands but opted to race for Canada in 2014 after failing to qualify for the last Olympics, was the first Canadian to win an individual Olympic speed skating event since Gaetan Boucher in 1984.
He was a picture of poise on the ice, skating evenly and staying under the punishing pace set by Bergsma through the gruelling 25-lap race, before ending with a late burst of speed.
Kramer, who had all of the Netherlands willing him to victory, ran out of steam in the Olympic event in which gold has consistently eluded him.
At the Vancouver Games eight years ago, Kramer finished first but was disqualified for choosing the wrong lane after his coach gave him the wrong instructions.
He struggling to hold on to third place on Thursday before steadily losing pace over the last quarter of the race.