With Colin Holderman on the 15-day injured list and David Bednar demoted to Triple-A Indianapolis, Derek Shelton had neither his setup man nor his All-Star closer for the final two innings Sunday.

That is the dilemma for the Pittsburgh Pirates manager in his attempt to navigate high-leverage situations by telling a beleaguered bullpen filled with relievers who have undefined roles to be ready for anything.

“We’ve got to trust our guys, we’ve got to trust their stuff,” Shelton said after Sunday’s 5-4 walk-off win in the 11th inning over the New York Yankees. “We have guys that are down there with good stuff. … I think we’re going to find our groove down there, but you’re going to see a lot of mixing and matching.”

Facing the top of a Yankees order that featured MVPs in Paul Goldschmidt, Cody Bellinger and Aaron Judge, Shelton opted for his top right-handed reliever to protect a three-run lead in the eighth. Dennis Santana got the first two to fly out, then watched as Judge’s 393-foot shot to center was caught at the warning track.

“With the right-handers we had available, he was the guy to go to, so we went to him there,” Shelton said of Santana. “Actually, it worked out perfect, well, perfect in our mind, because he got the right-handers and then, all of a sudden, we get that stretch of left-handers.”

With two left-handed hitters and potentially a switch hitter in the ninth, Shelton turned to lefty Ryan Borucki. The matchup made sense on paper, as Borucki hadn’t allowed a hit against six lefties this season. He started on a solid note by striking out Jazz Chisholm Jr.

But righties were hitting .300 against Borucki, and Anthony Volpe reached on a single to short. Third baseman Ke’Bryan Hayes barehanded an Austin Wells bunt for the second out, but Borucki walked the switch hitter, Jasson Dominguez, then gave up an RBI double to Oswald Peraza and a game-tying two-run single to Trent Grisham, who fouled off two pitches before hitting a 2-2 slider.

“It looked like he just threw too many breaking balls,” Shelton said of Borucki, who sandwiched two sliders around three sweepers. “Probably could’ve gone back to a two-seamer in, and it looked like Grisham started to lean out over the plate. We got the right matchups with the left-handers there … and Ryan has been very good versus left-handed hitters. I think it was just too many of the same pitch to a veteran player.”

Next up was righty Chase Shugart, who learned Saturday night that he was being recalled to replace Holderman (sprained right knee). Working with little sleep, Shugart took a 6 a.m. flight from Indianapolis and was tasked with getting Goldschmidt to ground out for the final out.

“I’ll take the ball whenever it’s handed to me,” said Shugart, acquired from the Boston Red Sox in January. “It doesn’t matter to me whether they need three innings, one out or one inning. I’m just focusing on what I can control and when my number is called, be ready to execute.”

Lefty Caleb Ferguson delivered a scoreless 10th despite having runners on first and third. Another lefty, Joey Wentz, overcame a throwing error by shortstop Isiah Kiner-Falefa that put the go-ahead run on third base in the 11th by striking out Peraza and getting Grisham to fly out to left.

“It’s not easy,” Pirates catcher Joey Bart said. “You’re in extra innings against the Yankees. The volume is turned up. These guys came in and did it. It was a blast. I had an absolute blast out there with these guys. The more confidence we can instill in our guys, the better we’re going to be, and we’re just going to keep moving forward.”

Ferguson started spring training with the promise that he would be stretched out as a starter before ultimately returning to a relief role. The eighth-year veteran, who hasn’t allowed a run in six appearances, finds it ironic that he could end up being asked to serve as a closer.

“When Shelty called me in and told me I was going back to the bullpen, I just told Shelty that I want to help get 27 outs wherever I can help get 27 outs and win a game,” Ferguson said. “That was my message to Shelty: I don’t care where you want me to get outs. I just want to get outs and win games.”

Ferguson said Pirates relievers have taken a “next-man-up mentality” since Bednar was optioned to the minors, a move that sent shockwaves throughout the bullpen and the clubhouse. The Mars alum is a two-time All-Star and two-time Roberto Clemente Award nominee for his community service and one of the team’s most popular players.

“Losing a guy like Bednar, people gravitate to him, he’s fun to be around and he’s had an extremely successful career so far – all the things you want out of a closing pitcher – so anytime you lose a guy like that, it’s kind of a ‘Oh, wow!’” Ferguson said. “It stings for a little bit but, at the end of the day, we’ve got to go win a game. As a group, when ‘Beddy’ got sent down, we know that’s not going to be a forever thing.”

Both Bednar and Holderman were struggling this season. Bednar gave up walk-off hits in two of the first four games and had a 27.00 ERA in three appearances, while Holderman had a 9.64 ERA and surrendered a three-run double in the fifth inning of Saturday’s 10-4 loss to the Yankees.

Ferguson expects both Bednar and Holderman to not only return to the Pirates soon but to return to form. Until then, the bullpen will continue the closer-by-committee approach toward accomplishing the hardest thing for a pitcher, getting the final three outs of the game.

“You check in on your teammates, make sure they’re in good head spaces and say, ‘Let’s move on from it. Let’s forget about that,’” Ferguson said. “It’s a small bump on our radar. If everybody goes out and has a great year, are you going to think about the two weeks in April that you weren’t with us? No. You’re going to forget about that. That’s the message with everybody: You’ve got to forget about the small things that you can’t control and go win some ballgames.”