Stocks closed marginally lower on Tuesday, taking a breather after posting strong gains to start off June.

The Dow Jones Industrial Average ended the day down 14.17 points at 26,048.51, erasing a gain of 185.99 points. The S&P 500 slipped less than 0.1% to 2,885.72 while the Nasdaq Composite finished just below breakeven at 7,822.57. The industrials sector was the biggest laggard in the S&P 500, dropping 0.9% as Raytheon shares declined by 5.1%.

The Dow also snapped a six-day winning streak. However, the S&P 500 remained around 2.4% below an intraday record.

"At this point, a failure to break out to new highs would be viewed as negative. The month is only a week and a half old, but we've got a head of steam now. We're seeing evidence of more individual stocks in the S&P 500 making new highs. There's a bit of an expectation the S&P 500 might be able to test those levels we saw in April," said Willie Delwiche, investment strategist at Baird.

"The potential headwind to that is what happens with sentiment. Sentiment turned so negative in May and now, as stock rebound in June, we're seeing pessimism being replaced with optimism. If it comes in too fast, that can shift from being a tailwind for stocks to a headwind," Delwiche said.