TOKYO—A key smartphone component and a niche mobile game are guiding Sony Corp. toward the highest fiscal-year profit in its 71-year history, a milestone reflecting a comeback for the long-troubled conglomerate.

For the fiscal year ending in March, Sony now anticipates an operating profit of ¥630 billion ($5.56 billion) on ¥8.5 trillion in revenue, revising its previous forecast of ¥500 billion on ¥8.3 trillion. The figure, if reached, would blow past the prior record, set in fiscal 1997, and back up the market consensus that years of huge losses and drastic overhauls are well behind the Japanese tech giant.

The revision was “unexpected” and a “blowout,” said Atul Goyal, an analyst at Jefferies. It came as Sony delivered a better-than-expected second-quarter operating profit Tuesday of ¥204.2 billion that was boosted by image sensors used in smartphones and the mobile game “Fate/Grand Order.”

Sony Chief Executive Kazuo Hirai has made all of Sony’s electronics businesses profitable, including the TV division, which had logged a decade of losses. Sony has shifted its focus on renewed growth, with Mr. Hirai emphasizing a recurring revenue model, and the smartphone component and mobile game reflect this business shift.

For the July-September quarter, Sony’s semiconductor unit, which includes the image sensor team, reported an operating profit of ¥49.4 billion. It is expected to post a fiscal-year profit of ¥150 billion, up ¥20 billion from the previous forecast. Demand for the company’s sensing sensor is expected to grow as Apple Inc.’s iPhone X’s face-recognition feature is likely to broaden the market. Sony said smartphone markers are seeking expensive chips to make their handsets stand out.