Yankees starting pitcher Carlos Carrasco delivers against the Kansas City...

Yankees starting pitcher Carlos Carrasco delivers against the Kansas City Royals during the second inning of an MLB game at Yankee Stadium on Monday. Credit: Kathleen Malone-Van Dyke

Other than Max Fried, a notable exception as the lefthander has pitched like an ace so far, the Yankees rotation in the early-going had been a train wreck.

Carlos Carrasco, backed by a four-homer night from the offense, helped provide some needed good news in the pitching department in the Yankees’ 4-1 victory over the Royals on Monday night at the Stadium.

Carrasco and four relievers combined to limit the light-hitting Royals, who got the tying run to the plate in the ninth against Devin Williams, to two hits (both by Bobby Witt Jr.).

Carrasco, 38, part of a rotation that entered Monday with the worst ERA (5.40) in the majors, was mostly terrific, allowing one run, one hit and two walks in five innings, striking out four.

The righthander, who gave up three home runs in the fourth inning of his previous start in Detroit and entered Monday 1-1 with a 7.71 ERA in three appearances (two starts), walked two batters in a 26-pitch first inning. But after allowing a two-out homer to Witt in the third, Carrasco retired the final seven batters he faced.

“Just moxie, man,” Aaron Boone said afterward of Carrasco, a non-roster invitee to spring training who made the club out of camp because of the injuries to Gerrit Cole, Luis Gil and Clarke Schmidt (scheduled to make his season debut Wednesday). “A big five innings by him.”

Boone praised Carrasco’s changeup, which the pitcher called “the key to the whole game.”

The Yankees (9-7), whose bats went mostly quiet in the bitter cold of Detroit and back here the first two games of a weekend series loss to the Giants, upped their season home run total to 32, hitting three of them in an electric fifth inning that saw Trent Grisham, Ben Rice and Austin Wells go deep off Seth Lugo. The Royals righthander finished second to the Tigers’ Tarik Skubal in AL Cy Young Award voting last season and historically had been tough on the Yankees (5-2 with a 2.55 ERA in 14 outings entering Monday, including four starts).

Lugo (1-2, 3.86) had allowed only one homer over his first three starts this season.

“We all know that he’s very aggressive in the zone, he doesn’t like to walk people,” said Jazz Chisholm Jr., who tied the score at 1 in the fourth inning by equaling Aaron Judge for the league lead with his sixth homer. “So I think we went in there with a plan of attack and get your pitch early. He throws like eight or nine pitches, but get your pitch early and attack it.”

Witt, who slashed just .118/.167/.118 during a 3-1 series loss to the Yankees in the ALDS last October, put the Royals (8-9) ahead 1-0 by driving a hanging slider out to left for his second homer of the year.

Royals catcher Salvador Perez led off the fourth by lacing a liner to left where Jasson Dominguez, who continues to steadily improve at what is still a new position, took an excellent route and made a running catch.

“Oh my God, he made a great play,” Carrasco said.

Dominguez, who struggled in the early part of spring training in leftfield but has been consistently working with third base and outfield coach Luis Rojas for months, had six putouts on Monday. Only the Perez play had a significant degree of difficulty but making the routine plays look automatic is a sign of continued growth.

“Not really,” Dominguez said of having doubts about eventually adjusting to leftfield. “I mean, I had some tough moments at first but I knew with the reps I’d be good.”

The Yankees offense, which had totaled three homers in its previous seven games, equaled that number in the fifth inning.

Grisham’s hot start continued when he led off the frame and blasted a full-count, 92-mph fastball to right-center for his fourth homer of the season to put the Yankees up, 2-1. Two batters later, leadoff man Rice cracked homer No. 5 on a 0-and-1 cutter to make it 3-1. Two batters after that, it was Wells hitting his third of the year, lining a first-pitch, 93-mph fastball into the seats in right to give the Yankees a 4-1 lead.

“It’s impressive,” Wells said of the outburst. “Anybody on any night can pick the lineup up and I think that’s what makes the lineup really good. I feel like we have the ability to be great.”

Fernando Cruz, Tim Hill, Luke Weaver and a struggling Williams shut down the Royals after Carrasco exited. Williams allowed a leadoff single to Witt in the ninth and walked Perez before retiring the next two batters to earn his second save.