FORT MYERS, Fla. — David Phelps went six innings Thursday night, giving up two runs on four hits and two walks with three strikeouts as the New York Yankees beat the Boston Red Sox, 3-2.

Phelps, who is trying to earn a spot in the starting rotation, faced a lineup close to what the Red Sox will field on opening day.

“It was fun, man,” Phelps said. “They put a lot of their regulars out there. I like that because I can see how my stuff’s playing against them. Those guys that have seen me before, I can see how my stuff is. It’s also a little easier because we have a scouting report on these guys. But that’s as close to a real game as I’ve had this spring. It was a good atmosphere with the crowd. It was a good night.”

Clay Buchholz went five innings, giving up three runs on five hits, with three strikeouts for the Red Sox.

Francisco Cervelli led off the second inning with a home run, his fourth of the spring, to give the Yankees a lead.

Red Sox center fielder Grady Sizemore, attempting to make his way back into baseball after being sidelined by injuries for more than two years, played a full nine innings. It was the first time this spring he had played a full game, and his second time playing in back-to-back games. He went 1 for 4 with a run. He’s batting .360 (9 for 25).

NOTES: Left-hander Craig Breslow, who is being brought along slowly because of last season’s increased workload, is scheduled to throw batting practice for the first time Friday and pitch in a game for the first time Monday. …

The teams combined for just 11 hits …

Left-hander Chris Capuano relieved Buchholz and went three scoreless innings. In his last two outings he has pitched six scoreless, hitless innings.

“He continues to throw the ball very well,” Red Sox Manager John Farrell said.

Before the game the Red Sox optioned right-hander Rubby De La Rosa and infielder Brock Holt to Triple-A Pawtucket, and reassigned infielder Brandon Snyder to minor league camp. The Sox have 40 players in camp.