Jacoby Ellsbury had sparked the Yankees to their early lead by drawing walks in each of the first two innings and scoring both times.
The game drew 6,870 to McKechnie Field, a new record for an exhibition opener at the park that has been the Pirates' spring home since 1969. The previous record was 6,367, in 2011 against the Rays.
Ellsbury also hit a hard infield single on his third trip to the plate in his game debut with the Yankees.
Two other big-ticket free agents also made their Yankees debuts, with Carlos Beltran going 0-for-3 and catcher Brian McCann going 1-for-2.
McCann and Ramon Flores drilled RBI singles in the first inning off left-hander Francisco Liriano, and Yangervis Solarte added a two-run homer off Edinson Volquez in the second.
The Bucs responded with a pair of runs in the bottom of the second, on a single by Jordy Mercer and Starling Marte's run-scoring grounder, both off reliever Bruce Billings. But the runs were charged to New York starter Ivan Nova, who went 1 1/3 innings.
Liriano, the Pirates' Opening Day starter, shrugged off getting hit hard in his one inning of work.
"I mainly worked on getting good command of the fastball," Liriano said. "The other pitches come around once I get the release point for the fastball. Physically, I feel 100 percent. My arm feels great. I only worry about getting ready for Opening Day."
The last time the Pirates saw Beltran, he was destroying them in the 2013 National League Division Series. His three-run homer triggered a seven-run third in St. Louis' 9-1 win in Game 1, and overall, he homered twice and drove in six runs in the five-game set.
Pittsburgh third baseman Pedro Alvarez hit three homers and recorded six RBIs in that same series, and they played to a draw in this meeting: Alvarez also went 0-for-3, with two strikeouts.
Up next: Hot outfield prospect Gregory Polanco is expected to make his first start of the spring on Thursday at 1:05 p.m. ET, when the Bucs visit Tampa for a rematch with the Yankees that will stream live on MLB.TV. Getting the start on the mound will be right-hander Charlie Morton, with lefty Jeff Locke and Brandon Cumpton among those expected to follow him.