Mike Moustakas smacked a two-out double to center against Yoervis Medina (4-4) before scoring when Perez lined a single to left to make it 4-3.
Greg Holland fired a scoreless ninth to notch his 38th save of the season.
Perez also cracked a solo homer, as did Alex Gordon for the Royals, who have won eight of their last 10 and moved four games within the Tampa Bay Rays for the AL's second wild-card spot.
Luke Hochevar (4-2) recorded the final two outs in the eighth to pick up the win.
Kyle Seager belted a two-run homer for Seattle, which has dropped its last three tilts.
The Royals jumped out to a 3-0 lead after plating a run in each of the first, fourth and fifth innings, but Seattle answered with a pair of runs in the sixth and pushed across another in the seventh to tie the contest at 3-3.
Gordon led off the home first with a shot into the bullpen in right, Perez's one-out homer in the fourth landed into the bullpen in left and Billy Butler's RBI single in the fifth made it 3-0 in favor of Kansas City.
Seager's two-run moonshot deep into the seats in right in the sixth and Brad Miller's RBI groundout in the seventh tied the tilt.
Kansas City starter Bruce Chen surrendered two runs on six hits over six frames, while Seattle starter Erasmo Ramirez allowed three runs on seven hits and three walks over 6 1/3 innings.
09/03 23:14:35 ET