TOKYO, Aug 31 (Reuters) - Japanese shares posted their second straight monthly gain on Wednesday, even as benchmark indexes closed lower for the day, weighed down by losses in heavyweight technology and energy firms and tracking Wall Street's weakness overnight.

The Nikkei share average fell 0.37% to 28,091.53 while the broader Topix lost 0.27% to 1,963.16. For the month, the Nikkei gained 0.93% while the Topix added 1.18%.

U.S. stocks extended losses to a third session on Tuesday, as a rise in job openings fuelled fears that the Federal Reserve has another reason to maintain its aggressive interest rate hike path to combat inflation.

"Japanese equities tracked Wall Street's third-straight losing session, but gains in U.S. futures limited the decline," said Maki Sawada, a strategist at Nomura Securities. "The impact of better-than-expected factory output data was limited."

Data showed Japan's factories extended expansion in output to a second month in July, as motor vehicle production improved, marking a positive start to the third quarter for manufacturers and broader economic activity.

Robot maker Fanuc lost 0.95% and Sony Group slipped 1.68%. Silicon wafer maker Shin-Etsu Chemical lost 1.06%.

Energy-related shares fell after oil prices dropped 5% overnight before recouping some of the losses in Asian trading hours on Wednesday.

Oil explorers were the top losers among the Tokyo Stock Exchange's 33 industry sub-indexes with a 3.16% drop. Refiners were the second biggest losers with a fall of 2.82%.

Explorer Inpex fell 3.55% and was the top loser on the Nikkei, followed by refiner Eneos Holdings, which declined 3.09%.

Transport shares led the gains among industry groups, with airlines rising 1.23% and railways adding 1.04%.

Keisei Electric Railway jumped 3.72% to become the top gainer on the Nikkei, while ANA Holdings rose 1.7%. (Reporting by Junko Fujita; Editing by Rashmi Aich and Subhranshu Sahu)