Farah added the 5,000m to his 10,000m title at the World Championships - a feat he also achieved at the London Olympics in 2012 and the 2013 Worlds.
Foster said: "Mo is the greatest sportsman that Britain has ever had."
Farah, 32, responded: "We have had so many legends and to be in the same category as them is amazing."
Farah has now gone ahead of Ethiopian Kenenisa Bekele who is the only other person to claim an Olympic and world 'double-double' in the distance events.
Farah now has five World Championship golds, two Olympic golds and five European golds, and is unbeaten on the track outdoors in a major championships since finishing second in the 10,000m at the 2011 World Championships in Daegu.
Foster, working as a BBC commentator at the championships, explained why he put the British runner on such a pedestal.
"He's Great Britain's most prolific winner of global golds and he's put former British athletes like Sebastian Coe and Daley Thompson behind him," he told BBC Radio 5 live.
"Former rower Sir Steve Redgrave [who won five Olympic golds] was part of a team. Mo is on his own and it's lonely out there. He's ruthless and we've not seen that. We should be enjoying the moment. We'll never see his like again."
Farah named Redgrave, ex-footballer David Beckham and former Manchester United manager Sir Alex Ferguson as his three greatest British sportsmen.
"We have had so many legends and to be in the same category as them is amazing," he said.
Multiple Olympic and world sprint champion Usain Bolt - who has won gold in the 100m and 200m in Beijing, as well as anchoring Jamaica to the 4x100m relay title - is a friend of Farah and added his praise.
"When it comes to Mo I'm never worried," the 29-year-old told BBC Radio 5 live. "When you are used to winning and dominating it comes easy.
"He knows what it takes to win and I had no doubt Mo would win."
Olympic medallist Brendan Foster has described Mo Farah as Britain's "greatest sportsman" after claiming the first distance 'triple-double'.