The 33-year-old British distance great, who won gold in the 5 000m and 10 000m at both the London 2012 and Rio 2016 Games, plans to retire from all track events to concentrate on road-racing after the World Championships in London in August.
In Birmingham, he was run close by Bahrain's Albert Rop, who managed to stay with Farah after he burst clear from the rest of the field before being beaten in a sprint finish.
"I had amazing support from the crowd today and I can't quite believe it's my last indoor race," Farah told the BBC after improving his own record for the event.
"I've had a great career indoors and particularly on this track," added Farah, who finished a disappointing seventh at last month's Edinburgh cross-country.