Pirates third baseman Pedro Alvarez broke a 1-1 tie in the fifth inning, blasting his second homer of the spring to left field on the first pitch he saw from right-hander Joel Peralta.
Sam Fuld evened it up in the bottom of the inning, reaching on a bunt single, stealing second, taking third on an error by Pirates catcher Rod Barajas and then scoring on Evan Longoria's sacrifice fly.
Battling for a spot in the rotation, Rays right-hander Jeff Niemann made quick work of a Pittsburgh lineup that likely included all of the club's regular starters. He breezed through the first three innings on just 27 pitches, striking out two batters, as he sat down the Pirates in order.
"Today was pretty smooth. I threw a lot of strikes, and they were pretty aggressive," Niemann said. "There were a lot of early balls put in play, and that kind of works into my hands when I'm throwing quality pitches out there."
Niemann got a little help from his defense in the second inning from left fielder Jesus Feliciano, who made a leaping grab to rob Neil Walker of a potential home run.
"I felt like we had a bunch of guys in there today seeing some action for the first time, so it was great to see those guys out there playing," Niemann added.
Right-hander Kevin Correia got the nod for Pittsburgh, his second of the spring, mowing down the Rays' first six hitters in order. Feliciano was the game's first baserunner, reaching on an infield single off Correia in the bottom of the third. Correia induced a double play to clear the bases, but allowed Will Rhymes to reach on a bunt single and walked Fuld before Carlos Pena grounded out.
Correia allowed two hits and one walk while striking out one batter on 54 pitches in three innings.
Longoria, making his first Spring Training appearance after suffering a bruised right hand, grounded out to the pitcher on a checked swing in the first inning, drew a walk in the fourth and tied the game with a fifth-inning sacrifice fly.
The Pirates broke the 2-2 tie in the top of the ninth when Jake Fox hit a solo home run off Josh Lueke. However, the Rays answered with two runs in the bottom half to walk off on a two-run single by Chris Gimenez against Doug Slaten.
Designated hitter Luke Scott also took his first at-bats since undergoing shoulder surgery last July, flying out to shallow left field in the second and striking out in the fourth.
Up next for the Pirates: Charlie Morton will make his first Grapefruit League appearance when he starts against the Phillies on Monday at McKechnie Field. The two-inning outing will complete the right-hander's recovery from October hip surgery. Another squad of Pirates will also be in action against The Netherlands in an unofficial game that will be part of the St. Petersburg International Baseball Tournament. Jeff Karstens will start in that one, with Daniel McCutchen among the other pitchers due to work. Both games start at 1:05 p.m. ET.
Adam Berry is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.