In a tactical race, Farah could not respond to a challenge for the first time in six years, turning his farewell race on the track at a major championship into a disappointment.
Having won gold in the 10,000m Farah was the favourite to take the 5,000m gold as well.
Andy Butchart then raced to the front alongside Farah briefly on the penultimate lap, as Yomif Kejelcha and Edris took over at the bell.
Farah still doubled Great Britain's medal tally, remaining the only GB athlete to have won any honour at the home championships.
"I gave 110 per cent", he said in the immediate aftermath. "It's not an excuse, but it took a lot more out of me than I realized".
Edris finished in 13mins 32.79secs, with the United States' Paul Chelimo third.
British athletics legend Mo Farah narrowly failed to complete a fifth successive global double on Saturday when he finished second behind Ethiopian Muktar Edris in a thrilling 5,000 metres world final. That's what they did tonight, and the better man won on the day.
As the group went through the 3,000m mark Australian Patrick Tiernan was the one who made a decision to change the pace and he opened up a little gap between Chelimo, Farah and the rest of the pack.
Farah was welcomed to the start line by another roar from the London Stadium crowd and urged them to keep going with a wave of the hand in the opening paces.
For Farah, there will be no comeback on the track, as he now moves up the marathon looking to extend his gold medal haul.