NEW YORK — The way manager Joe Girardi described it, for weeks Bryan Mitchell was throwing from a chair with his injured foot elevated just to keep his arm in shape down in lonely Florida.

Boy, are the Yankees happy Mitchell didn’t have to sit out all season.

Mitchell earned his first major league win, combining with Luis Severino and Tyler Clippard to shut down the dangerous Toronto Blue Jays, and New York kept up its surprising surge with a 2-0 victory Wednesday night that completed a three-game sweep.

“After the whole season, what I went through, tonight’s very rewarding,” Mitchell said. “It’s been my goal all year to get back here.”

Starlin Castro homered and Brian McCann had an RBI single for the Yankees, who have won four straight and 10 of 14. They closed within 2 1/2 games of Baltimore for the second AL wild card and are 4 1/2 behind first-place Boston in the AL East.

“We’ve been playing playoff baseball really since about Aug. 1,” Girardi said. “We keep getting closer, and that’s the idea here. And it’s been fun.”

The skidding Blue Jays dropped out of first place for the first time since Aug. 12. They fell a game behind new division leader Boston, which won 7-2 in San Diego.

“We’re right in it. We just need either a big play or a big hit somewhere to get us going back in the right direction,” catcher Russell Martin said. “You’re not going to see any panic from me.”

Marcus Stroman (9-7) struck out eight in five innings but the Blue Jays lost for the fifth time in six games. They were swept for the third time this season, first since May 16-18 by Tampa Bay.

Toronto’s power-packed lineup has been blanked on six occasions this year, three at Yankee Stadium.

Making an unexpected run at the playoffs after trading several veteran stars for prospects this summer, the youth-infused Yankees (73-65) climbed a season-best eight games above .500. They were finally able to finish off a sweep, too.

The Yankees had lost in each of their previous seven attempts at a series sweep of at least three games and were 2-9 in those situations this season before wiping out the Blue Jays.

“We’re playing really good baseball. We’re excited for this last month,” McCann said.

Helped by two double plays, Mitchell (1-0) yielded four hits over five-plus innings in his fourth career start and first major league outing this season. The 25-year-old right-hander pitched in place of injured rookie Chad Green.

“It feels weird coming back at this point in the season,” Mitchell said.

Mitchell was promoted Tuesday from Triple-A after missing much of the year because of an injury to his left big toe sustained late in spring training. He entered 0-3 in the majors, working mostly in relief for New York over the past two years, but became the third Yankees rookie to have a scoreless start in the past three-plus weeks.

“I don’t think you could ask for any more,” Girardi said.

A leadoff double by Devon Travis in the sixth ended Mitchell’s night before Severino tossed three innings of one-hit ball.

Travis got caught breaking for third on Josh Donaldson’s comebacker and was tagged out in a rundown. Severino was aided by a replay reversal in the seventh, and Edwin Encarnacion flied out to the right-field wall with a runner on to end the eighth.

Clippard, filling in as the closer with Dellin Betances and Adam Warren unavailable, struck out two in a perfect ninth to finish the five-hitter. His only other save this season came with Arizona before he was traded back to New York.

Castro hit his 20th homer with two outs in the third. Didi Gregorius doubled, Mark Teixeira walked and McCann singled sharply to right field.

HOW SWEEP IT IS

It was New York’s first sweep of a division foe since July last year against Baltimore, and its first of the Blue Jays since June 2014, also at Yankee Stadium.

SPREADING IT AROUND

Three different pitchers earned saves in the series, and four have saves in New York’s last six wins. Clippard became the AL-high eighth reliever to get a save for the Yankees this year, matching a franchise record.

TRAINER’S ROOM

Blue Jays: LHP Francisco Liriano (back) was unavailable. … Martin (left knee) was lifted for a pinch hitter in the ninth.

Yankees: Rookie catcher Gary Sanchez was given the night off. RF Aaron Judge also was rested before entering on defense in the seventh. Sanchez and Judge will be back in the starting lineup Thursday, Girardi said. … Betances probably will be unavailable again Thursday, Girardi said. The big closer threw 40 pitches Tuesday, his third straight day of work.

UP NEXT

Blue Jays: Following an off day, Toronto begins a pivotal, three-game series Friday night at home against Boston. RHP Marco Estrada (8-7, 3.56 ERA) starts the opener for the Blue Jays against Rick Porcello (19-3, 3.23), the major league leader in wins.

Yankees: LHP CC Sabathia (8-12, 4.20) pitches Thursday night in the opener of a four-game series against last-place Tampa Bay. New York was shut out by Baltimore in both of his last two outings. Rays RHP Alex Cobb (0-0) makes his second start since returning from Tommy John surgery.