Pena drove in a run with a first-inning sacrifice fly and added a three-run blast in the third to give the Rays a 5-1 lead.
Longoria capped the scoring with an eighth-inning sac fly and Tampa Bay took the opener of a three-game series at Tropicana Field with their seventh win in nine contests.
They entered the game tied with the New York Yankees atop the American League East.
Wade Davis (11-9) gave up six hits and two runs over 7 2/3 innings, fanning three without a walk.
Blue Jays starter Brett Cecil (11-7) surrendered five hits and five runs (two earned) over seven innings.