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."

Media playback is not supported on this device
Adams, 33, beat China's Ren Cancan - who she beat to win gold at London 2012 - in Thursday's semi-final.
The Leeds woman lost the first of four two-minute rounds, before coming back to win the final three.
She will face France's 10-time national champion Sarah Ourahmoune in Saturday's gold-medal match (18:00 BST).
"Another gold-medal fight - I can't wait. This is what I've been training for for the last four years. I'm excited," she told BBC Sport.
It is guaranteed to be GB's first gold or silver boxing medal at Rio 2016, although super-heavyweight Joe Joyce could also reach his final.
The 30-year-old Londoner meets Kazakhstan's Ivan Dychko in Friday's semi-final ahead of Sunday's gold-medal bout.
Defeated semi-finalists do not fight again and both receive bronze medals.
Joshua Buatsi won Team GB's first boxing medal in Brazil by securing bronze at light-heavyweight.
Adams has achieved virtually everything there is to achieve in boxing, having already won Olympic, European and Commonwealth golds.
But she showed her determination to add another Olympic title - becoming the first Briton to defend her crown after middleweight Harry Mallin in 1924 - by coming from behind against Ren.
Ren, a three-time world champion, took the opening round on all three judges' scorecards, but Adams came out aggressively in the next to pin back her 30-year-old opponent with her powerful left jab.
She knocked Ren off balance as she restored parity at the halfway stage, also going on to win the final two rounds 10-9 across the board.
"Four years is a lot of time to for a boxer to change and strengthen their weaknesses so I just had to go and stick to the tactics," Adams said.
"The jab won me the fight, it just paid off. I am always nervous and you need that nervous energy to give you the adrenaline."
Anthony Joshua, 2012 Olympic super-heavyweight champion on BBC TV:
"I am sure Nicola will be familiar with Sarah Ourahmoune - the French and British spar a lot together.
"I think Nicola will control her with jabs and keep busy to not give her an opportunity to attack."
Olympic medallist Brendan Foster has described Mo Farah as Britain's "greatest sportsman" after claiming the first distance 'triple-double'.
[NEXT_CONCEPT]
Nicola Adams continued her bid to become the first British boxer to retain an Olympic title for 92 years by reaching the women's flyweight final.