Perez hit his 23rd home run of the season to highlight a four-run fourth. Santana gave the Royals the lead with a three-run homer to right in a five-run seventh.
“I think it got lost there at the end, but we were down six runs,” Royals manager Mike Matheny said. “I can’t think of another team that I have been around that is as resilient as this team.”
“We never quit, we just competed to the last out,” Perez said. “Nobody put their head down and there was a lot of energy in the dugout.”
Kyle Funkhouser (4-1) allowed all five runs in the seventh for Detroit.
“It was not Funkhouser’s sharpest outing,” Tigers manager A.J. Hinch said. "They just kept pecking away at him and came up with a huge swing with Santana.”
The Tigers pounced on Carlos Hernández early, backed by Jeimer Candelario and Miguel Cabrera. Hernández gave up five runs, four earned, on two hits with four walks in 2 2/3 innings with two strikeouts.
A three-run home run by Candelario in the third gave Casey Mize a comfortable lead.
Mize struck out six in 4 2/3 innings but gave up four runs on six hits with a walk.
Akil Baddoo hit a two-run homer in the ninth for the Tigers, his ninth of the season and fourth in the last 11 games.
Tarik Skubal (6-8, 4.18 ERA) will take the mound for Detroit in the series finale. Daniel Lynch (0-2, 15.75 ERA) will make his fourth career start for Kansas City.
Eovaldi expected to start as Red Sox host the Yankees
New York Yankees (86-67, third in the AL East) vs. Boston Red Sox (88-65, second in the AL East)
Braves to face Padres on the road
Atlanta Braves (80-71, first in the NL East) vs. San Diego Padres (77-75, third in the NL West)
Wells expected to start as Baltimore hosts Texas
Texas Rangers (55-98, fifth in the AL West) vs. Baltimore Orioles (49-104, fifth in the AL East)
Gilbert, Mariners to face Suarez, Angels
Seattle Mariners (84-69, second in the AL West) vs. Los Angeles Angels (73-80, fourth in the AL West)
Gray scheduled to start as Cincinnati hosts Washington
Washington Nationals (64-89, fifth in the NL East) vs. Cincinnati Reds (78-75, third in the NL Central)
Bieber expected to start as Indians host the White Sox
Chicago White Sox (86-67, first in the AL Central) vs. Cleveland Indians (75-77, second in the AL Central)