Kevin Pillar hit a two-run homer with two outs in the eighth inning to lift the Blue Jays over the Kansas City Royals 6-5.
Ken Giles worked a perfect ninth for his 14th save and second with the Blue Jays since being acquired from Houston on July 30.
Salvador Perez and Jorge Bonifacio hit back-to-back doubles in the seventh off Jake Petricka (2-1) to give the Royals a short-lived 5-4 lead.
Adalberto Mondesi had a career-high four hits, including two doubles, stole three bases, drove in a run and scored a run for Kansas City.
The Blue Jays, who had scored four runs in their previous four games total, jumped to a 3-0 advantage.
Teoscar Hernandez and Kendrys Morales walked to lead off the second and both scored.
Pillar contributed a two-out RBI single, while the other run scored when Diaz grounded into a double play.