When the Yankees acquired J.A. Happ last week, they were confident his recent performance with the Blue Jays didn’t tell the full story of the left-hander’s effectiveness.

Happ had pitched to a 6.03 ERA in his final six starts for Toronto, hardly the stuff of leading a rotation into the postseason.

On Sunday, Happ proved the Yankees were right to have brushed those struggles aside, as Happ delivered a strong outing in his Bronx debut.

He gave up just one run in six innings and the Yankees got a two-run homer in the first from Aaron Hicks to beat the Royals, 6-3.

It was just the second time in nine games the Yankees got six innings from a starter. Masahiro Tanaka provided the other length with his shutout.

Sunday’s victory also provided the Yankees with a much-needed series victory, as they took three of four from the last-place Royals and stayed 5½ games behind the seemingly unbeatable Red Sox, who beat the Twins again in Boston.

“That was huge for us,’’ said Austin Romine, who was behind the plate as Happ gave up just three hits and a walk and didn’t give up a run until Salvador Perez took him deep with two outs in the sixth.

“That’s why we got him,’’ the catcher said. “He knows how to pitch. He’s been in situations before where he’s had to pitch well. Today he was really professional and his demeanor on the mound was calm. He’s been there before.”

Despite his outward appearance, Happ said he did have some nerves pitching for a new team.

“You definitely want to have good results,’’ Happ said. “They traded for you. There’s some pressure in that.”

But he was able to overcome it.

“I felt like I lost some adrenaline after that first inning,’’ Happ said. “I was amped up, ready to go, but I was trying to battle through there, trying to get ahead. That was a big thing for me.”

By then, the Yankees were up 5-0 and well on their way to winning consecutive games for the first time since July 11-12.

If Happ really was revved up, it was news to Romine — who didn’t see any sign of nerves from the veteran hurler.

“Not even a little bit,’’ Romine said. “He’s so calm on the mound and with the way he pitches. If he was [nervous], I couldn’t see it. I thought it was just business as usual. He was fun to catch.”

Happ also got solid run support, as the offense got to Kansas City right-hander Burch Smith in a hurry.

With two outs and no one on in the first, Didi Gregorius walked. Hicks followed by trying to bunt against the shift, but pushed it foul. He then drilled a two-run homer off the right-field foul pole to give the Yankees a 2-0 lead.

In the fourth, Hicks sent a bullet leadoff double to right and came around on Miguel Andujar’s two-out single to center to make it 3-0.

The Yankees opened the fifth with singles by Brett Gardner and Giancarlo Stanton. Both runners advanced on a Gregorius groundout. Hicks walked to load the bases for Gleyber Torres, who grounded to second.

Originally called a double play, the Yankees challenged and second baseman Whit Merrifield was ruled to have missed the tag on Hicks. Gardner scored and the inning was extended. Bird then hit a slow roller toward second, but Merrifield, playing deep because of the shift, couldn’t get to it in time and Bird had an RBI single.

The Royals finally got to Happ in the sixth with Perez’s homer, but a sacrifice fly by Stanton in the bottom of the inning put the Yankees up 6-1.

Chad Green and David Robertson gave up homers to get the Royals to within three runs, but Aroldis Chapman closed it with his second save in as many days.

And the Yankees got a much-needed win.

“Now I feel like I’m settled in,’’ Happ said.