* MasterCard rises after earnings reports
* Alcoa gains on buyout rumor
* Dow up 0.1 pct, S&P down 0.2 pct, Nasdaq down 0.6 pct (Updates to midday, changes byline)
By Caroline Valetkevitch
NEW YORK, May 3 (Reuters) - The S&P and Nasdaq declined on Tuesday as investors sold commodity-related shares, with the market straying further from a recent rally.
Shares of Alcoa Inc, however, shot up 3.7 percent to $17.86, helping to support the Dow, on market talk that Rio Tinto was lining up a bid to buy the U.S. aluminum producer. Neither Alcoa nor Rio Tinto would comment.
The energy sector, which gained 16 percent in the first quarter, led losses on the S&P 500. The S&P energy index dropped 1.5 percent Tuesday.
"You've had a tremendous run-up here, so you've got some profit-taking and an underlying rotation," out of commodity-related shares into more defensive sectors, such as utilities, said Paul Mendelsohn, chief investment strategist at Windham Financial Services in Charlotte, Vermont.
The S&P utilities index was up 1.2 pct.
Mendelsohn said any pullback would likely be short term and sees the market staying on an upward trend. The S&P has gained nearly 30 percent since the start of September.
The Dow Jones industrial average rose 16.42 points, or 0.13 percent, at 12,823.78. The Standard & Poor's 500 Index was down 2.84 points, or 0.21 percent, at 1,358.38. The Nasdaq Composite Index fell 16.47 points, or 0.58 percent, at 2,847.61.
MasterCard Inc rose 3 percent to $283.40 after the world's second-largest credit card processing network posted a 24 percent jump in quarterly profit.