And Serena Williams, the 37-year-old US star chasing a record-tying 24th Grand Slam singles title, won her opener in the US Open tuneup tournament, defeating 20th-ranked E Mertens of Belgium 6-3, 6-3 in 75 minutes.
Osaka, the reigning US and Australian Open champion, won after taking the first set 6-2 when Germany's Tatjana Maria retired with a left abdominal injury.
Osaka had not played a match since losing to Yulia Putintseva in the first round at Wimbledon.
"I thought I played really well despite the fact that we only played one set," Osaka said. "I think that I was able to do what I wanted, which was go for the shots that I had the opportunity to.
"And, of course, there were a couple unforced errors, but I think that's part of the process.
"For me, I'm just happy that it was my first match in a while and I was able to get in the groove of things quickly."
The victory gives Osaka the inside track on taking the top spot in Monday's new rankings.
Third-ranked Karolina Pliskova of the Czech Republic, however, could overtake Barty, the French Open champion who lost in Toronto on Tuesday, and Osaka to seize the number one ranking as well.
Pliskova defeated 37th-ranked American Alison Riske 6-4, 6-7 (4/7), 6-2.
"It was tough in the second set," Pliskova said. "But after just a little bit of energy, I went with good shots and good serves and it was much better in the third set."
The 27-year-old Czech must reach the semi-finals for any chance at taking world number one, but if Osaka makes the last eight, Pliskova must reach the final to have a hope at being number one next week.
Pliskova will next play Estonia's 19th-ranked Anett Kontaveit, who made the third round when Spain's Carla Suarez Navarro retired with an injury at 7-5, 3-1 down.
Romanian fourth seed Simona Halep outlasted American Jennifer Brady 4-6, 7-5, 7-6 (7/5).
Ukraine teen Dayana Yastremska beat two-time major winner and former number one Victoria Azarenka 7-5, 7-5.