Her time of five minutes 21.56s was two seconds faster than the record set by Genzebe Dibaba indoors in 2017.
Niyonsaba, a world and Olympic Silver Medal winner over 800m, is among several athletes banned from competing between 400m and 1,500m because of naturally high levels of testosterone.
While Niyonsaba is one of a number of athletes who have been forced to change events by a 2019 ruling by governing body World Athletics, she has excelled over longer distances.
Her world record run, which also broke the outdoor record set by Ireland’s Sonia O’Sullivan in 1994, came a week after claiming victory over 5,000m in the Diamond League meeting in Zurich.
At the Tokyo Olympics she finished fifth in the 10,000m final but was disqualified from her 5,000m heat for a lane infringement.
Later in the summer she became the fifth-fastest woman of all time over 3,000m.