TOKYO, Aug 19 (Reuters) - Japan's Nikkei eked out small gains on Wednesday, as some technology firms rallied after U.S. tech giants drove the S&P 500 to a record peak overnight, and in dollar terms the benchmark is very close to reaching a three-decade high.

The Nikkei share average rose 0.26% to 23,110.61, after two straight sessions of losses. The broader Topix edged up 0.18% to 1,613.73. In dollar terms, it stood at 219.10, just 0.3% below its 2019 peak, which was the highest since 1990.

"Some technology shares that benefit from new types of demand after the coronavirus epidemic will continue to do well. But for the overall stock index to rise, investors need more positive factors to buy," said Norihiro Fujito, chief investment strategist at Mitsubishi UFJ Morgan Stanley Securities.

Softbank Group, which invests in tech firms around the world, rose 3.3% while Nintendo gained 1.0% to a 12-year high.

IT equipment and service firms Fujitsu and NEC gained 2.4% and 3.7%, respectively.

The Mothers index rallied to a two-year high, with Modalis Therapeutics, which listed earlier this month, gaining 10.4%.

Sony, meanwhile, dropped 2.8% following the news that Third Point LLC has sold off a large part of its investment in the company, although some investors think the long-term impact of the U.S. activist fund's move would be negligible.

Sony was also under pressure due to concerns over Washington's tightening restrictions on sales to China's Huawei Technologies.

Other Huawei suppliers also dropped, with Taiyo Yuden losing 1.3% and Murata Manufacturing shedding 0.8%.

The market showed little reaction to domestic data showing an unexpected drop in machinery orders as well as a fall in exports.

Trade was slow due to summer lull, with the main board's turnover at 1.697 trillion yen about 30% below the average. (Reporting by Hideyuki Sano; Editing by Aditya Soni and Shailesh Kuber)