PITTSBURGH — Throughout a spring training that featured few hits and early in a regular season with the same results came a reoccurring question regarding Chris Carter’s signing.

Why?

The Yankees signed Carter, who shared the National League lead in homers last season with 41, to a one-year, $3.5-million deal on Feb. 7, but without a specific role in mind beyond a righthanded-hitting option against some lefthanders.

It finally paid off — in a big, loud way — on Saturday afternoon.

After a critical two-out error opened the door in the eighth, pinch hitter Carter clubbed a tiebreaking three-run homer to spark a five-run inning in the Yankees’ 11-5 win over the Pirates.

advertisement | advertise on newsday

“It makes you feel like you’re a big part of the team when you win a game like that for a team,” Joe Girardi said. “It can get a guy going. It was big for him and it was big for us.”

Carter, whose playing time has been sporadic, destroyed a first-pitch changeup from lefthander Felipe Rivero to give the Yankees an 8-5 lead. Carter, who went 8-for-57 in spring training, entered the day 4-for-27 in the regular season.

“It’s always tough coming off the bench. It’s something new for me, but I think going forward, it’s going to start working for me,” Carter said. “Going up there today, I had the confidence I would be on time with it and ended up hitting it.”

The Yankees (11-6), winners of 10 of their last 12, rallied from a 3-0 deficit entering the sixth with two five-run innings on their way to their highest run total of the season. They had 13 hits, including four by Ronald Torreyes and two each by Aaron Judge and Austin Romine, and Dellin Betances picked up two key outs in the seventh to strand a runner at third and preserve a 5-5 tie.

The Yankees hit three homers, giving them 25 in 17 games. Starlin Castro’s three-run shot tied the score at 3-3 in a five-run sixth and another monster homer by Judge, estimated at 457 feet, made it 11-5 in the ninth and gave him a team-leading six. Torreyes capped the sixth-inning rally with a two-run double.

Yankees videos

After their bullpen coughed up a 5-3 lead and the Pirates (7-10) tied it at 5-5 in the sixth, the Yankees took advantage of some slipshod Pirates fielding in the eighth.

Rivero got the first two batters and seemed to have a third retired when Romine — who collected the Yankees’ first hit of the day with two outs in the fifth — sent a routine grounder to second. But Adam Frazier booted the ball for an error and Torreyes followed with a single.

Carter came next and hit the ball with such force that centerfielder Andrew McCutchen barely moved as he watched it sail well over his head.

“I think it’s important that you get him his at-bats,” Girardi said of Carter, whom he has started five times at first base and once at DH. “Sometimes people ask why I sit a guy here or sit a guy there . . . You can’t have one at-bat every week and expect a guy to be productive. You have to get guys at-bats because they’re going to come up in some big situations. Like he did today.”

Another error by the Pirates, their fifth in two days, contributed to two more runs that made it 10-5, with Chase Headley contributing an RBI double.

advertisement | advertise on newsday

“This team is explosive,” Girardi said. “I think we have the ability to hit the ball out of the ballpark and we can put up some quick runs. And I think it’s a pretty resilient group. A group that really believes in each other, and that really helps.”