Youkillis drilled his third spring homer with a man on in the first, and doubled home a run in the second. Both blows came off Pirates starter Phil Irwin (0-1).
Irwin walked the first two men he faced in the third. Mike Zagurski relieved him with one out and also walked Dan Johnson to load the green-colored bases for Mesa, who unloaded them with a shot into the left-center bleachers.
The Pirates (9-13) broke through in the fourth on RBI doubles by Pedro Alvarez and Gaby Sanchez, with Travis Snider adding a sacrifice fly later in the inning to make it 8-3.
Clint Barmes added a solo homer, his second, in the fifth.
Up next: The Yankees will have their second off-day of the spring on Monday. They return to action on Tuesday against the Phillies in a 1:05 p.m. ET start at Bright House Field in Clearwater. Adam Warren is scheduled to make his third spring start and fourth appearance for New York, opposite Kyle Kendrick.
Tom Singer is a reporter for MLB.com and writes an MLBlog Change for a Nickel. He can also be found on Twitter @Tom_Singer. This story was not subject to the approval of Major League Baseball or its clubs.