Ernesto Martinez Jr. had the game-tying and game-winning hits Friday night as the Scranton/Wilkes-Barre RailRiders rallied to beat the Rochester Red Wings in extra innings for the second consecutive night, 4-3, at PNC Field in Moosic.

For seven innings, the RailRiders were stymied by Red Wings starter Andry Lara. The righthander allowed just two singles to Yanquiel Fernandez in the second and seventh innings, did not walk a batter and struck out nine.

Rochester handed him a 2-0 lead on two solo home runs. Phillip Glasser hit one leading off the top of the third off RailRiders starter Adam Kloffenstein, while Yohandy Morales hit the other off Yerry De Los Santos with two outs in the top of the fifth.

However, the bullpen held the Red Wings there, so that when Lara left the game after seven innings, the RailRiders offense was able to rally against the Rochester bullpen.

Paxton Schultz relieved Lara to begin the bottom of the eighth and issued a leadoff walk to Seth Brown. Duke Ellis pinch-ran and stole second on Schultz’s first pitch to Martinez. With the count full, Martinez hit a cutter out to right field for a home run that tied the game at 2.

Neither team scored in the ninth and the game went to extra innings. In the top of the 10th, Morales lined a double into the right field corner to easily score automatic runner Dylan Crews from second and put the Red Wings back in front, 3-2. Andres Chaparro singled to put runners at the corners. Harrison Cohen relieved Danny Watson and struck out the next two Rochester batters to keep it a one-run game.

In the bottom of the 10th, with Oswaldo Cabrera on second as the automatic runner, Ellis laid down a sacrifice bunt and safely reached when Rochester first baseman Abimelec Ortiz was called for obstruction. Cabrera moved to third on the play. Again, on the first pitch to Martinez from Jackson Rutledge, Ellis broke for second on a stolen base. Rutledge’s pitch was wild and went to the backstop, enabling Cabrera to score the tying run and Ellis to race to third.

Martinez then lined a single to right field on a 2-2 pitch to plate Ellis with the winning run and give the RailRiders (13-11) their third victory in four games in the series.

Yankees shortstop Anthony Volpe continued his rehab stint with the RailRiders and played nine innings for the first time. Batting leadoff, he went 0 for 4 with a fly out, two strikeouts and a groundout. In the field, he handled three chances and had two assists. The plan is for him to play nine innings again Saturday, then likely DH on Sunday.

The series continues Saturday at 3:05 p.m. at PNC Field. Dom Hamel (0-3, 9.72 ERA) is scheduled to start for the RailRiders. Rochester will go with righty Riley Cornelio (2-0, 2.45).