CC Sabathia started his 500th game Tuesday night, and it was far from his best.

The 37-year-old southpaw allowed two home runs that produced four earned runs in a 4-3 loss to Detroit. He struck out just three batters in six innings and allowed six hits and a walk.

With the loss, the Yankees (57-48) dropped to a half-game behind Boston (59-49) in the American League East.

Sabathia and manager Joe Girardi each said Sabathia’s slider and changeup were primary factors in his struggles Tuesday night.

“Those two pitches really didn’t do much for me,” Sabathia said. “It was either catching too much plate or off the plate. The changeup was like cutting, so it’s just up to me to start trusting the grip again.”

In the second inning, Sabathia allowed a leadoff single to Miguel Cabrera and a double by Nicholas Castellanos before John Hicks hit his fourth home run of the year, a high fly ball that barely avoided Aaron Judge’s outstretched arm at the rightfield wall.

advertisement | advertise on newsday

The Yankees also benefited from their home field’s small dimensions in right when Didi Gregorius hooked a line drive just inside the rightfield foul pole for a two-run homer in the fourth inning. Sabathia already had surrendered another homer, a Justin Upton shot to left, so the Yankees trailed 4-2.

“You look at the three-run homer he gave up, it’s not going to be a home run in a lot of ballparks but we took advantage of that, too,” Girardi said.

Despite allowing four earned runs in two straight starts, Sabathia has posted solid numbers since the middle of May. In 11 starts since May 16, he is 7-2 with a 2.54 ERA.

That stretch has the free-agent-to-be looking like he’ll get another contract. If it happens, who knows how many more starts he will make?

Only 47 other pitchers have started 500 games. Sabathia is just the second — behind Tom Glavine — to make his first 500 appearances as a starter.

Yankees videos

“He must have been pretty good to have 500 starts because there aren’t a lot of people to get that many starts in the big leagues when you start thinking about on average 30 a year, 32 a year,” Girardi said when asked to reflect on the milestone. “Ten years, you’re still a long ways away, so you must have been pretty good. I think we can all say that about CC.”