Farah had already won the 10,000m last week with the 34-year-old the only GB athlete to have won an individual honour at the home championships.
Britain's men won a stunning 4x100m relay gold as the women took silver.
"It's been wonderful. It's been a long journey but it's been incredible".
"It doesn't quite hit you until you compete here until after crossing the line and having a few minutes to myself, you realise this is it". I didn't have a single bit left at the end.
Edris finished in 13mins 32.79secs, with the United States' Paul Chelimo third.
Farah is due to retire from the track at the end of the month, after the Diamond League final in Zurich, to focus on the marathon.More news: Sunderland house destroyed in explosion
After a brief burst from Farah's compatriot Andrew Butchart at the front of the race, the Ethiopian trio of Edris, Yomif Kejelcha and Selemon Barega moved up to box in the home favourite.
He fell several metres behind them going down the back straight.
Farah finally found open track but Edris was gone, with the Briton passing the fading Kejelcha and holding off Chelimo to salvage silver.
He also won the 5,000m at the 2011 worlds, giving him 10 global golds in all.
To rub in his victory after years of the Ethiopians being tormented by Farah's brilliance, Edris even gave an impression of his rival's famed "Mobot" celebration as he crossed the line. That was despite what the BBC commentary from Brendan Foster and Steve Cram would have led you to believe for much of the race.
Sir Mo Farah couldn't follow up his 10,000m efforts after he was tested by Ethiopia's Muktar Edris. "This man has beaten the legend that is Mo Farah in his own back yard".More news: Trump declares opioid crisis 'national emergency'
Two-time Olympic decathlon champion Daley Thompson: "He has got to be hurting".
"Mo has many victories but now I have one", said the 23-year-old. "I did the Mobot out of respect as well for him".
Thankfully Farah has delivered, albeit not with the double-gold everyone hoped, but where would we be without him?
"I thought it might be possible, but my legs had had it", said Farah. I am the next champion.
"This London crowd is wonderful - there is no place like home".
"I don't think there was any more I could have done".More news: John Mayer pays tribute to Glen Campbell on Nashville stage
Day nine at the World Athletics Championships in London sees the action come to a close with the final day of events.