Pineda (1-1) dominated like the pitcher the Yankees have always hoped he would become. He struck out 11, walked none and threw 67 of 93 pitches for strikes. Tampa Bay's Logan Morrison homered with one out in the eighth, a ball that hit off the top of the wall in right-center and deflected off a fan before bouncing back onto the field. A video review was needed to determine it was a home run.
Pineda started 15 of his first 18 batters with strikes and didn't fall behind 2-0 in a count until the sixth inning. His slider had a sharp downward break, and fans started sensing the occasion in the sixth, cheering on every strike and rising for every out.
Longoria reached on a first-pitch hanging slider and tipped his helmet to Pineda after reaching second. Leading 2-0 at the time, Pineda then fanned Brad Miller.
Aaron Judge, Chase Headley and Starlin Castro homered for the Yankees, who broke open the game with a five-run eighth inning and won their second straight following a 1-4 start.
A hard-throwing 28-year-old right-hander obtained from Seattle after the 2011 season, Pineda has been an enigma in New York. He was 6-12 with a 4.82 ERA last year, the 68th-highest ERA among 74 qualifying pitchers in the major leagues, yet struck out a team-high 207 and led the AL with 10.6 strikeouts per nine innings.
"It's mind-boggling," Yankees manager Joe Girardi said before his final start last season. "It just doesn't make sense."
Tyler Clippard and Chasen Shreve combined for perfect relief. New York won its home opener for the 16th time in 20 years.
New York took a 2-0 lead against Alex Cobb (1-1) on Jacoby Ellsbury's RBI double in the third and Judge's home run in the fourth, his second in two days. Headley, batting .375, led off the seventh with his second home run, and Matt Holliday chased Cobb with a run-scoring double in the eighth.
Cobb, who beat Pineda in Florida last week, gave up five runs - four earned - and six hits over 7 1/3 innings for the Rays, who had been off to a franchise-best 5-2 start. Chris Carter greeted Austin Pruitt with an RBI triple, and Castro followed with a two-run homer.
It was sunny and 76 degrees at game time, more than double the 36 for last year's Yankee Stadium opener.
New York built six new fan gathering areas in the stands, including two where there had been obstructed-view bleacher seats. The sold-out crowd of 46,955 included Hall of Famer Reggie Jackson, released Yankees third baseman Alex Rodriguez and former Secretary of State Henry Kissinger. Ceremonial first pitches were thrown by former Yankees manager Joe Torre and old New York stars Tino Martinez and Willie Randolph, part of the staff for the championship U.S. team at the World Baseball Classic.
Ellsbury doubled into the right-center gap in the third to drive in Brett Gardner, who reached on a wild pitch as he swung at strike three. Judge hit an arching 397-foot home run an inning later to left-center - MLB's Statcast said it had an apogee of 147 feet.
Gardner moved to the locker next to the entrance by showers, formerly occupied by Carlos Beltran and before that Jorge Posada. Matt Holliday took over Rodriguez's stall to Gardner's left, and Austin Romine moved into Gardner's old space toward the center of the room.
"Decent real estate," Gardner said.
On the third base side, a new carpet in a lighter gray was installed in the visitors' clubhouse.