By David Ljunggren
Northug, the favorite, dug into his last reserves as the skiers entered the stadium and sprinted past Teichmann just when it looked as though the German had done enough to win.
"I knew that if I stayed with him I could beat him in the stadium," Northug told reporters.
Sweden's Johan Olsson came third in a race marred by rain and snow, which made the going slippery and caused several crashes. Switzerland's Dario Cologna was in contention for the bronze when he slipped and fell on the last bend.
The previous tightest finish in a men's 50 km race was in the 2006 Games, when Italy's Giorgio Di Centa won by 0.8 seconds.
Going into the 50 km, the equivalent of the marathon at the Summer Games, all the attention was on Northug, who had been tipped to win virtually everything he entered.
Yet he flopped in the 15 km and 30 km events and could only win bronze in the individual sprint. He also won a team gold and a team silver.
Unusually warm weather had made the track soft and conditions were not helped by a quick downpour as the racers set off. Northug changed his skis the maximum three times allowed during the race.
The 24-year-old was happy to stay in the leading pack for virtually all of the race, generally staying between five and 10 seconds behind the leader.
He gradually moved up to the front and by the end of the race was well prepared when Teichmann made his move on the final hill.
"My plan was to stay in the group and attack on the last hill," Northug said.
(Editing by Ed Osmond)