PITTSBURGH — CC Sabathia didn’t have it Friday night, a first for the 36-year-old lefthander this season.

As Joe Girardi put it: “It didn’t seem like he had his good fastball, his cutter wasn’t good, his slider was not great and his changeup wasn’t great.”

Nonetheless, after rough first and second innings in which he allowed four runs, Sabathia managed to grind through five innings and depart with his team trailing by a run.

But the bats that so consistently bludgeoned opposing pitching during a just-completed 8-1 homestand never got things going against the Pirates. Sabathia’s mediocrity, a lackluster outing by the offense and a dropped pop-up by Starlin Castro that handed Pittsburgh two unearned runs in the seventh led to a 6-3 loss by the Yankees in front of 30,565 at PNC Park.

“Felt pretty good, but the stuff was just a little short today,” Sabathia said. “We just tried to battle and keep the team as close as possible but came up short.”

The loss, only the second in 11 games for the Yankees (10-6), started a six-game trip that includes two more games against the Pirates (7-9) and three next week against the Red Sox.

advertisement | advertise on newsday

Sabathia (2-1), who saw his ERA rise from 1.47 to 2.70, allowed four runs and seven hits, including a home run to centerfield by Jordy Mercer on his second pitch of the game and a two-run shot to leftfield by Josh Bell in the second that made it 4-0. His fastball velocity dipped from 90-92 mph in his first three starts to mostly 87-89 Friday night.

“Catching these guys, you can tell when they might not have ‘A’ stuff, but with C, that’s not going to really matter,” Austin Romine said. “He’s still going to grind through innings. That’s what he did for us.”

Sabathia retired 10 of the last 12 he faced, departing after five with the Yankees trailing 4-3.

It stayed that way until the seventh, when Adam Warren, who retired the first four batters he faced after coming on in the sixth, walked Mercer. He struck out Josh Harrison and seemed to be out of the inning when Andrew McCutchen skied one behind second. Castro was in position to make the catch, but the ball popped out of his glove. Mercer scored and, after Tommy Layne walked Gregory Polanco, David Freese’s single off Jonathan Holder made it 6-3.

“It’s my fault,” said Castro, who had two of the Yankees’ 10 hits. “That’s a play that I should make, especially in a close game like that when we have a chance to win the game in the last two innings.”

Yankees videos

Said Girardi: “It’s probably going to happen once out of, what, 100 times maybe? But it was the time that it happened and it’s unfortunate. It led to a couple runs and they got a more comfortable lead, but we had chances.”

They sure did, but they went 0-for-7 with runners in scoring position and stranded 11, including four in the final two innings.

Pinch hitter Matt Holliday struck out with runners on second and third to end the eighth. With two outs in the ninth, Castro and Jacoby Ellsbury (three hits) singled but Aaron Judge grounded into a forceout, allowing Tony Watson to pick up his fifth save in as many chances.

Pirates rookie righthander Tyler Glasnow, making his third start, allowed three runs (one earned) and seven hits in 4 2⁄3 innings. Four relievers allowed three hits in 4 1⁄3 shutout innings and took Pittsburgh, which committed three errors to the Yankees’ one, to the finish line.

Trailing 4-0 early, the Yankees got back in the game in the third. Brett Gardner walked and Chase Headley ripped a double into the rightfield corner. Jose Osuna booted the ball, which allowed Gardner to score to make it 4-1.

advertisement | advertise on newsday

Headley got to third on a nice piece of baserunning, then took the Yankees out of the inning with some not-so-nice work on the bases.

He took third on Castro’s groundout to third, waiting for Freese to field the ball and start his throw before taking off for the unoccupied base. But after Ellsbury walked and stole second, Headley took off on contact on Judge’s grounder to third and easily was thrown out at the plate.

Greg Bird struck out to end the inning, but he played a significant role as the Yankees climbed within one in the fifth.

Ellsbury started the two-out rally with a single and Judge followed with a hit. Bird, after launching a second drive in as many at-bats that nearly left the stadium but hooked foul, then hit a grounder into the shift. Second baseman Harrison, who was playing deep on the outfield grass, butchered it, and both Ellsbury and Judge scored to make it 4-3.

“We had a lot of chances tonight,” said Bird, who went 0-for-4, dropping him to 5-for-41. “Guys are doing their job getting on base and me, and whoever else, I have to do a better job getting them in when they’re on base.”