The Yankees closed out the surprisingly solid first half of their season Monday night with an effort in their 81st game that gave them reason to think the rest of the year might not be half-bad, either. Masahiro Tanaka again showed that he has much left in the tank and that, perhaps, he is just getting warmed up.

For the third start in a row, Tanaka was in true midseason form. He stifled the Blue Jays through seven innings in a 6-3 win at Yankee Stadium, lifting a team just back from a 3-4 trip.

Monday night had the invigorating effect of a football Homecoming, giving the Yankees a chance to relish having five American League All-Stars. Tanaka performed like a Homecoming king, gaining his 11th win in his past 15 starts in the Bronx but only his first since May 2.

It had not been a typical first half for Tanaka (7-7, 5.25 ERA) by any measure. This game was vintage, as he allowed one run, five hits and a walk with eight strikeouts in seven innings.

He left with a 2-1 lead and his team extended it to 6-1 with four runs in the eighth before withstanding a rocky ninth by Aroldis Chapman. All told, it was what the Yankees needed, having lost 14 of 19 despite five All-Star selections Sunday.

“I feel better out there and it’s definitely going in the right direction,” Tanaka said through an interpreter, mindful that he hadn’t often been part of the exhilaration his team has felt through an unexpectedly strong start. But he might be getting there.

advertisement | advertise on newsday

First there was the scoreless eight-inning no-decision against the Rangers on June 23, then the road win against the White Sox last Wednesday. The latter snapped a six-game losing streak and eight-game winless stretch.

“He’s our guy. He’s a ‘1’ and he’s been a ‘1’ for a while now,” said Chase Headley, who also had a big game with three RBIs. “Obviously, the season has not started the way he hoped or the way he’s capable of, but by the same token, we know what kind of pitcher he is and what kind of pitcher he’s going to be going forward.’’

After singles by Aaron Judge and Gary Sanchez and a walk loaded the bases against Patchogue-Medford’s Marcus Stroman (8-5, 3.42) in the first inning, Headley was hit in the right leg and Jacoby Ellsbury drew a walk for a 2-0 lead. Stroman got Ronald Torreyes to hit into an inning-ending double play. But Tanaka was tougher, longer.

Tanaka’s velocity has been up lately, which has surprised him when he has looked at the miles-per-hour reading on the video screen. (Does he always look at that number? “No,” he said in English with a smile. “Sometimes.”)

“He has been really, really good,’’ Sanchez said through an interpreter after going 2-for-4 and ending the eighth by retiring Josh Donaldson trying to steal second. “In the past couple starts, his split has been really good, his slider is really good and his curveball. When a pitcher has all his pitches working, usually you have really good results.”

Yankees videos

The Yankees scored four runs in the eighth, two on Headley’s bases-loaded double to right. The final two scored when catcher Luke Maile couldn’t hold on to a throw as Didi Gregorius slid into the plate (and the bat) and the ball dribbled away, allowing Headley to score.

The Blue Jays scored twice against Chapman on doubles by Kendrys Morales and Kevin Pillar and a single by Darwin Barney before pinch hitter Russell Martin lined out to end it.

A game like this makes the Yankees believe that 44-37 might be only the midpoint of something better.

“We have an opportunity in front of us, and I think that’s what you ask for,” Joe Girardi said. “We went through a pretty tough stretch here, whether it’s been losing some tough games or losing some players or seeing a gruesome injury [to Dustin Fowler]. But our guys have continued to respond. So I feel pretty good about where we’re at.’’

advertisement | advertise on newsday