The Rays, who moved one game in front of Boston in the AL East, won on the road for the first time since June 29, at Pittsburgh.
Jackson (6-7), who was 5-15 last season, did not yield a hit until Billy Butler homered to center with two outs in the fifth.
John Buck led off the sixth with a homer, the only other hit Jackson allowed.
Jackson allowing two runs in five-plus innings, walking two and striking out two. Jackson and four relievers held the Royals to four hits.
Carlos Pena's 16th homer with two outs in the ninth gave the Rays a 5-2 lead. It was Pena's 14th career home run against the Royals.
Troy Percival worked the ninth for his 21st save, but gave up a homer to Ross Gload.
The Royals had two baserunners over the first four innings, but Jackson erased both on double-play grounders.
Alex Gordon walked with one out in the second, but Butler grounded into a double play. David DeJesus struck out to lead off the fourth, but reached first on a passed ball charged to Dioner Navarro. Mark Grudzielanek's grounder to shortstop Jason Bartlett started an inning-ending double play.
Akinori Iwamura led off the game with a single and scored on Evan Longoria's two-out single.
The Rays made it 2-0 with an unearned run in the fifth. B.J. Upton led off the inning with a double, took third on second baseman Grudzielanek's throwing error and scored on shortstop Mike Aviles' fielding error, when he dropped Pena's line drive.