Castro, who played shortstop for the first time this spring, cleared the batter's eye in straightaway center field on his fifth-inning blast. He is batting .417.
"I'm happy we got him," manager Joe Girardi said. "I think he's going to be a big part of our club."
Refsnyder paced the Yankees' offense with three RBI, pushing them ahead after right-hander Masahiro Tanaka gave up four hits and two runs in two innings. He threw just 30 of 50 pitches for strikes.
"A lot of long counts," Girardi said. "I didn't think he was extremely sharp. You're going to have those days early on in spring training, his third start. So, we'll build off it."
In the first inning, Andrew McCutchen hit Tanaka's first offering onto the boardwalk beyond the left-field wall for his third home run in four games. After a balky knee slowed his start last year, McCutchen said he is healthier than ever this spring.
"I feel pretty strong, as you can see," McCutchen said. "I feel good."
Locke surrendered six hits and five runs in five innings. He walked two and struck out two.
"Made some mistakes leaving the ball up over the plate," Locke said.
Luis Severino, the Yankees' 22-year-old right-hander, struck out five over four scoreless innings to earn his first win. He walked away unscathed after a brief scare in the fifth inning when Starling Marte ripped a line drive back at the mound. Severino fell to the dirt but made the catch.
"I was lucky," Severino said. "I saw it all the way, heading for my face, put up my glove and caught it."
Pirates: LHP Cory Luebke (hamstring) made his spring debut against the Yankees and pitched a scoreless ninth. Luebke is considered a candidate for the final spot in the Pirates' bullpen, which is likely to go to a left-handed pitcher -- other options are Kyle Lobstein and Eric O'Flaherty. . Acquired last week, 3B David Freese finally reached full strength and went 1 for 3 in his Pirates debut.
Yankees: CF Aaron Hicks was scratched from the lineup because of a stye in his eye. He visited an eye specialist and is expected to be out a few days, according to Girardi. . C James McCann returned to the lineup for the first time since Sunday, when he fouled a ball off his knee. . LF Brett Gardner came through his spring debut well Wednesday and is expected to play every other day through the weekend.
Yankees: LHP C.C. Sabathia is in line to pitch Friday against the Baltimore Orioles in Tampa.