Tigers manager Brad Ausmus issued the challenge and replay officials in New York overturned first-base umpire Bill Miller's out call, and Castellanos reached on the error with one out.
Don Kelly replaced Castellanos as a pinch-runner, and the next batter, Alex Avila, crushed a two-run home run to make it 5-1.
It was the Tigers' second homer in the inning against Royals reliever Aaron Crow, who gave up a leadoff blast to J.D. Martinez.
Jackson Alexander is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.