NEW YORK (Fortune) -- Yahoo on Wednesday moved another chess piece in its bid to fend off a hostile takeover by Microsoft, announcing it will outsource advertising space to Google as part of a short-term deal that could lead to a bigger partnership.

As part of a two-week trial, Google-generated ads will appear next to some U.S. search results on Yahoo (YHOO, Fortune 500). The experiment raises the possibility that Google could run Yahoo's search advertising service.

Yahoo's move - clearly an attempt to show its unwanted suitor that it has other options - was quickly met with resistance. Microsoft general counsel Brad Smith suggested that a formal Yahoo-Google alliance would be anticompetitive, and a powerful Congressman warned that he would be watching the two-week test "closely."

The discussions with Microsoft's biggest rival come less than a week after Yahoo was given a 3-week deadline by Microsoft (MSFT, Fortune 500) to negotiate a proposed $42 billion buyout or face a drawn-out battle for control of Yahoo's board.

The test with Google (GOOG, Fortune 500) attempts to show that Yahoo has some bargaining power as it pressures Microsoft to raise its $31-a-share bid. It also addresses one of Yahoo's biggest challenges: containing costs as the economy slows and revenue growth slips. If Yahoo can find a partner to help carry the expense of the necessary network operations, it may succeed in its plan to expand its own higher-margin banner ad business.

AOL and Time Warner (TWX, Fortune 500) are now in advanced discussions to combine their Internet operations. Google also powers search results for AOL, a Time Warner unit and Fortune.com affiliate. In addition, the New York Times reported Wednesday that Microsoft is talking with News Corp (NWS, Fortune 500). about a joint bid for Yahoo.

The limited scope of the Yahoo-Google test and the potential antitrust issues raised by a collaboration between the two largest search players suggests the move will not necessarily be a deal killer for the Microsoft-Yahoo takeover.

Microsoft fired back Wednesday with a warning that a formal Yahoo-Google alliance would give Google too much control over the the search advertising market. "Any definitive agreement between Yahoo! and Google would consolidate over 90% of the search advertising market in Google's hands," Smith said in a statement. "This would make the market far less competitive, in sharp contrast to our own proposal to acquire Yahoo!"

Meanwhile, Sen. Herb Kohl, a Wisconsin Democrat and chairman of the Senate Judiciary Committee's antitrust subcommittee, said Wednesday he would be "following closely" the Yahoo-Google trial.

"Following closely on the heels of Google's acquisition of DoubleClick, this Google-Yahoo alliance would represent even further consolidation in the Internet advertising market," Kohl said in a statement issued shortly after Yahoo made the announcement. "Should there be moves to make this agreement permanent, we will examine it closely in the Antitrust Subcommittee to ensure that it does not harm competition.

While the experiment suggests a potential partnership between the two search engine giants, Yahoo was quick to de-emphasize the significance of the move.

"The testing does not necessarily mean that Yahoo will join [Google's] AdSense for Search program or that any further commercial relationship with Google will result," Yahoo said in a statement.

Yahoo, along with a new effort by large stakeholder Legg Mason, is attempting to show that the company can thrive on its own. The risk here is that Yahoo may see Microsoft pull its offer leaving Yahoo to actually go it alone.