July 7 (Reuters) - The S&P 500 and Dow industrials slipped on Thursday, weighed by energy shares, but gains in Costco and tech shares lifted the Nasdaq Composite.

The energy sector of the S&P was dragged lower by Exxon and Chevron as oil futures prices fell nearly 5 percent after crude stockpiles fell slightly less than forecast.

High-yielding sectors also pulled the S&P lower even as yields on long-term U.S. government debt remained near record lows.

"The utilities and the telecoms are also weak sectors. That's really selling into the strengths of higher dividend stocks," said Tim Ghriskey, chief investment officer of Solaris Group in Bedford Hills, New York.

"There's clearly some profit taking occurring there for no particular reason."

The Dow Jones industrial average fell 22.74 points, or 0.13 percent, to 17,895.88, the S&P 500 lost 1.83 points, or 0.09 percent, to 2,097.9 and the Nasdaq Composite added 17.65 points, or 0.36 percent, to 4,876.81.

The utilities sector of the S&P was down the most at 1.8 percent after having risen sharply since Britain's vote to leave the European Union triggered a run to safer sectors of the market. The telecom services sector was down 1.6 percent.

Costco was the largest gainer on the Nasdaq and the S&P a day after it reported June comparable sales rose more than expected. Shares ended up 4.9 percent at $163.70, a seven-month high.

U.S. labor market data also gave the market support ahead of the monthly payrolls report due on Friday. The ADP national employment report showed that 172,000 jobs were added in the private sector in June, beating economists' expectation of 159,000.

The weak jobs report for May raised concerns about the recovery in the economy and was seen as throwing the Federal Reserve off track from its plans to raise U.S. interest rates in the near term.

"Right now, I think you have to look at the numbers and say it probably was just a one off, which should reassure the Fed," said Brad McMillan, chief investment officer for Commonwealth Financial in Waltham, Massachusetts.

Shares of Humana Inc closed down 9.6 percent at $162.74 after a source familiar with the situation said the U.S. Department of Justice has significant concerns about Aetna Inc's proposed acquisition of Humana. Aetna shares were down 4 percent at $115.47.

"There could be some more announcements out of that which require more asset sales or even bring the merger itself into question," said Solaris Group's Ghriskey of a scheduled DOJ meeting with both insurers on Friday.

Advancing issues outnumbered declining ones on the NYSE by a 1.21-to-1 ratio; on Nasdaq, a 1.34-to-1 ratio favored advancers.

The S&P 500 posted 34 new 52-week highs and one new low; the Nasdaq Composite recorded 59 new highs and 25 new lows.

About 6.70 billion shares changed hands in U.S. exchanges, compared with the 7.78 billion daily average over the past 20 sessions. (Additional reporting by Yashaswini Swamynathan in Bengaluru; Editing by Rodrigo Campos and James Dalgleish)