TORONTO — Michael Pineda had been so good for much of this season that it was easy to forget the inconsistency that had plagued the vast majority of his career.

Then he dropped a clunker Friday night as a reminder.

Allowing a season-high 10 hits and striking out a season-low one in five innings, Pineda missed few barrels in the Yankees’ 7-5 loss to the Blue Jays in front of 44,261 at Rogers Centre.

“It’s tough because this is a really good lineup, so you want to compete with your best stuff on the mound,” Pineda said. “For me today, I didn’t have my best stuff.”

After falling behind 5-0 in the fourth, the Yankees (31-21) got two-run homers in the sixth from Aaron Judge and Starlin Castro to cut the deficit to one but were unable to tie it and fell to 2-3 on this seven-game trip.

Pineda (6-3, 3.76) allowed a season-high five runs and three walks, which tied a season high. It was his shortest outing since he went 3 2⁄3 innings against the Rays on April 5. He had made nine straight starts in which he allowed three or fewer earned runs.

advertisement | advertise on newsday

Pineda allowed three first-inning runs on the first of Josh Donaldson’s two homers and a two-run shot by Justin Smoak.

“His stuff wasn’t sharp, his location wasn’t good,” Joe Girardi said. “You look at the first slider to Donaldson that he hit, he hasn’t thrown many sliders like that.”

Blue Jays lefthander Francisco Liriano, activated earlier in the day from the disabled list after experiencing shoulder inflammation, allowed two runs and four hits in five innings-plus.

Judge’s two-run shot off Liriano in the sixth, the rightfielder’s MLB-leading 18th homer, and Castro’s two-run homer off righthander Danny Barnes made it 5-4. But the Yankees’ bullpen could not hold down the Blue Jays (27-28), who have won nine of 11.

Jonathan Holder allowed Donaldson’s second homer, a one-out shot in the sixth that made it 6-4. After Matt Holliday’s two-out RBI double in the top of the seventh brought the Yankees within 6-5, Adam Warren allowed an unearned run in the bottom of the inning.

Yankees videos

Roberto Osuna worked a perfect ninth for his 12th save.

The Yankees went 0-for-9 with runners in scoring position and stranded seven, with the majority of that frustration taking place in the first three innings. They put a man on third with none out in the first and loaded the bases with one out in the third but could not score either time.

“We missed some opportunities,” Girardi said. “You’re not going to play a perfect game every night, that’s the bottom line.”

Warren was victimized by some bad luck in the seventh in trying to keep it a one-run game. Smoak hit a grounder in the hole at second and Castro made a diving stop. He threw to first baseman Chris Carter, who could not find the bag, according to umpire Eric Cooper. The Yankees challenged, as it appeared Carter’s toe touched the bag, but the call stood after a replay challenge, likely because of inconclusive evidence.

“I thought I touched the bag,” said Carter, who was charged with an error. Troy Tulo witzki’s double and Devon Travis’ sacrifice fly produced the unearned run.

advertisement | advertise on newsday

The Yankees continue to get little production from their corner infielders. Chase Headley has slumped severely since a good April — he has nine hits in his last 75 at-bats and is hitting .232 with three homers and 23 RBIs in 48 games — and Carter hasn’t been good from the start, hitting .182 with four homers and 14 RBIs in 39 games.

First baseman Greg Bird, on the disabled list since May 2, began a rehab assignment Thursday and should return soon. With each game that top prospect Gleyber Torres gets at third base — he’s rotating between third, short and second with Triple-A Scranton/Wilkes-Barre — the fans’ clamoring grows louder.

“It’s been up and down,” said Carter, who doubled in the third and was stranded. “I felt good the last few days up there but just haven’t gotten hits.”

Girardi said of the contributions from the corner infielders: “You’d like to get more. They’re trying and we’ll keep trying.”