NEW YORK — Salvador Perez homered leading off the fourth inning to spark a four-run rally against Carlos Rodón, and the Kansas City Royals beat the New York Yankees, 4-2, on Monday night to even their AL Division Series at one game apiece.

Four relievers held New York in check after an inconsistent Cole Ragans lasted four innings. Tommy Pham, Garrett Hampson and Maikel Garcia singled in runs for the Royals.

Garcia, moved up from ninth to first in Kansas City’s batting order, had four hits.

Game 3 in the best-of-five playoff is Wednesday night at Kansas City, the Royals’ first postseason home game since the 2015 World Series.

“It’s basically like a brand-new series when we get to the K,” Ragans said, referring to Kauffman Stadium.

Yankees slugger Aaron Judge went 1 for 3 with an infield single and is 1 for 7 with four strikeouts in the series. Kansas City star Bobby Witt Jr., expected to finish second to Judge in AL MVP voting, was 0 for 5 with three strikeouts, dropping to 0 for 10 in the series.

All four Division Series opened 1-1 for the first time since the round started in 1995.

Giancarlo Stanton put the Yankees ahead with an RBI single in the third, but New York went 1 for 6 with runners in scoring position and is 3 for 19 in the two games.

“They were making their pitches when they needed to,” Judge said. “We’ve got to come through in those situations to kind of break it open.”

Ragans allowed just the one run and three hits, striking out five and walking four. Winning pitcher Angel Zerpa and John Schreiber each followed with a hitless inning before Kris Bubic threw two scoreless innings. Lucas Erceg worked the ninth for his third save this postseason.

Erceg gave up a leadoff homer to Jazz Chisholm Jr. and a two-out single to Jon Berti but retired Gleyber Torres on a grounder to end it with slugger Juan Soto on deck. Chisholm’s homer was the first off Erceg since June 12, when he was still pitching for Oakland.

Perez, at 34 the only remaining Royals player from their 2015 championship team, tied the score when he drove a 2-0 slider into the left-field seats. The nine-time All-Star entered 12 for 26 (.462) with three homers off Rodón, an old AL Central rival when he pitched for the Chicago White Sox.

“He falls behind him, and from there started making some mistakes with his secondary (pitches) just in the heart of the plate,” Yankees manager Aaron Boone said.

Yuli Gurriel singled, advanced on a wild pitch and scored on Pham’s one-out single for a 2-1 lead, prompting cheers from NFL fans at the Kansas City Chiefs’ home game against New Orleans at Arrowhead Stadium. Pham stole second and scored on a two-out single by Hampson.

Garcia greeted Ian Hamilton with an RBI single that put the Royals ahead 4-1.

Rodón, lined up to pitch a potential Game 5, gave up four runs and seven hits in 3⅔ innings with seven strikeouts and no walks. Twenty-four of the 32 home runs he has allowed this season have been solo shots.

“Just have to be better with those pitches,” Rodón said. “Just, more fine with them and get to better spots.”