The deal, which covers mobile and desktop search, will take effect when the latest version of Firefox launches in December.
"At Yahoo, we believe deeply in search—it's an area of investment, opportunity and growth for us," said Marissa Mayer, Yahoo's CEO, in a statement. "This partnership helps to expand our reach in search and also gives us an opportunity to work closely with Mozilla to find ways to innovate more broadly in search, communications, and digital content."
It was not immediately clear how the agreement will affect Yahoo's existing arrangement with Microsoft, whose Bing search engine currently powers Yahoo's web search capabilities.
Firefox had 10.4 percent of the U.S. browser market on desktop PCs, mobile smartphones and tablets last month, according to tech data firm StatCounter. Google's Chrome browser was the leader with 33.5 percent.
Flush with cash from Alibaba's IPO, Yahoo is said to be on the hunt for acquisitions. It recently signed a $640 million deal for video ad firm BrightRoll.
Shares of Yahoo rose more than 1 percent in after-hours trade.
—Reuters contributed to this report.
Disclosure: CNBC has a content-sharing partnership with Yahoo's finance site.