TOKYO, March 6 (Reuters) - Japan's Nikkei share average narrowly missed out on a record close for a second session on Wednesday as tech shares weighed on the index following declines in U.S. peers overnight.

Tech was the worst performing sector on the Nikkei and in the broader market, precision machinery and electric machinery were among the bottom three performers from the Tokyo Stock Exchange's 33 industry groups.

The Nikkei finished the day 0.02% lower at 40,090.78, after several forays above Monday's all-time closing high of 40,109.23. However, the index never came close to challenging the record intraday peak at 40,314.64, also set on Monday.

The broader Topix rose 0.39%, with a sub-index of value shares gaining 0.71%, while growth shares edged up 0.07%.

The Nikkei has still surged nearly 20% in 2024, powered majorly by tech shares amid the global euphoria over artificial intelligence (AI).

A weakening yen, down about 6% this year, has also made Japanese stocks more attractive to the foreign funds that have mainly driven the rally.

"After realising such a steep rally since the start of the year, it seems like we've now entered a period of speed adjustment", which is likely to last until the Bank of Japan and Federal Reserve policy meetings the week after next, said Kazuo Kamitani, an equity strategist at Nomura Securities.

"Until then, the market will be sounding out a floor" and as long as the Nikkei does not fall far below 39,000, "it'll be an indication of an extremely strong market", he said.

Chip-testing equipment maker Lasertec dropped 3.74% to be the Nikkei's biggest percentage decliner. Chip-maker Renesas lost 3.09%.

Other notable decliners included AI-focused startup investor SoftBank Group m which fell 1.49%. Uniqlo store operator Fast Retailing was the biggest drag in terms of index points with a 0.93% slide. (Reporting by Kevin Buckland; Editing by Sherry Jacob-Phillips and Sohini Goswami)