Research firm comScore reported Yahoo logged 196.6 million unique visitors in July, compared with its rival's 192.3 million. This is the first time Yahoo has topped Google in traffic since May 2011.
When Google alum Marissa Mayer started at Yahoo last July, the company trailed Google by 5 million page views - with 163 million unique visitors to Google's 190 million - and was fighting public perception that it would never catch up.
Yahoo slowly narrowed the gap with Google this year as Mayer focused on overhauling the company's Web properties, such as its e-mail service and the photo-sharing site Flickr.
"Those things matter," said Andrew Lipsman, an analyst for comScore. "When a company can re-engage or re-spark interest, it has ancillary benefits" across the network.
Google and Yahoo are likely to continue to fight it out for the top spot, Lipsman said. For Yahoo, the numbers are particularly impressive because they do not include the firm's acquisition of blogging site Tumblr, he said. If July's numbers had included traffic to Tumblr, Yahoo would have seen about 6 million additional users, he said.
Mayer has said she aims to make Yahoo products daily habits for users, and she has ordered redesigns of many of the firm's most used products. She also has cut less lucrative products, such as the early search engine Altavista, which Yahoo shuttered early last month.
Meanwhile, Mayer has gone on an acquisition run, including paying $1.1 billion for Tumblr in May. Over the past year, Yahoo has picked up more than 20 companies that could help inject new life into everything from the company's ads to its mobile apps.
Yahoo is currently in third place for mobile traffic, comScore reported, trailing behind Facebook and Google. But as the company revamps its products, its standing could improve, Lipsman said.
Yahoo shares gained as much as 3.5 percent during Thursday trading, ahead of a glitch that stopped trading on the Nasdaq. Stock closed up 3.1 percent at $27.90 a share.