The 19-year-old former kitchen porter, winner of the first esports championship in Abu Dhabi last November before teams got involved, had looked set for a hat-trick after winning on Australian and Chinese Grand Prix layouts.
Leigh also led on the last lap of the tricky Baku street circuit but made mistakes that allowed Toro Rosso's Danish racer Frederik Rasmussen to slipstream past with the line in sight to win by a whisker.
Leigh, who has gone fully professional and shed 20 kilos since a title win that changed his life, finished second and leads his Hungarian Mercedes teammate Daniel Bereznay by 27 points.
The Briton has 68, Bereznay 41 and Rasmussen 27.
Leigh, sitting with all the other sim racers in race seats at the Gfinity Arena, controlled the opening Albert Park round from pole position with a Bereznay second before a time penalty for speeding in the pitlane dropped him to sixth.
The defending champion started the second, Shanghai, race from fifth on the grid but fought through to lead a Mercedes one-two.
The other rounds are due to stage at the same venue on Oct. 31 and Nov. 17.
(With inputs from agencies.)