Ohuruogu caught Jamaican Novlene Williams in the last few metres in a pulsating final to win in 49.61 seconds with fellow Briton Nicola Sanders taking silver in 49.65.
Williams, who had looked to be home and dry coming off the final bend, had to settle for the bronze in 49.66.
Ohuruogu's victory completed a remarkable comeback for the Commonwealth Games champion, who has just returned from a year's suspension for missing three out-of-competition doping tests.
"This time last year I was in complete turmoil," she told reporters. "I didn't know what I was doing. It hasn't quite sunk in yet.
"I'm just very happy I worked hard and everything came together at the right time.
"On the finish line I said 'was it me?'... it's unbelievable," she said. "I had butterflies I can tell you. Never in my wildest dreams could I have thought of coming back after my ban as world champion," she added, her voice breaking with emotion.
Runner-up Sanders could not resist a dig at critics who had written off British hopes of winning gold medals in Osaka.
"We proved them wrong," smiled the European indoor champion. "You can't ask for more than that. It's fantastic. But of course I would have like it to have been the other way round."
The event had been thrown wide open after American record holder Sanya Richards failed to qualify at the U.S. championships.