After Ernesto Frieri (3-1) relieved, Butler bashed a pitch more than 400 feet over the center field fence, tying the score.
The next batter, Perez, followed by clanking a Frieri offering off the left field foul pole to win it for the Royals, evening their three-game series.
The comeback made a winner of Kelvin Herrera (4-2), who tossed a scoreless ninth in relief of Jeremy Guthrie. The Kansas City starter went eight innings, yielding a pair of runs while walking one and striking out two.
Greinke had to settle for a no-decision after giving up just one run on five hits in 8 1/3 innings.
Kendrys Morales socked a solo homer for the Angels, who came into the contest 2 1/2 games out of an American League wild card spot.