SOUTH BERWICK — When the Massabesic High girls’ lacrosse team needs to score, it often looks for Madison Drain or Maquila Dimastrantonio.

So when Josie Ring had the ball in the closing minutes of the Class A South final with the game tied, she was going to pass, right?

Wrong. Ring broke in from the left side and bounced in a shot with 1:27 remaining, giving the Mustangs a 7-6 win Wednesday against Marshwood, the defending state champion.

“I saw an opening and just went for it,” Ring said. “It was a rush of adrenaline and I just ripped it.”

Massabesic’s other goals came from Drain (four) and Dimastrantonio (two). Marshwood, the No. 1 seed, got two goals apiece from Hannah Costin and Reagan Nichols. Costin also had two assists. Marin Smith added a goal and an assist, and Abigail Rowe scored the other goal for the Hawks.

The second-seeded Mustangs (14-1) avenged their only loss and moved on to the Class A final Saturday at Fitzpatrick Stadium against the North’s top seed, Messalonskee (13-1).

This will be Massabesic’s fourth appearance in the state championship game. The Mustangs won titles in 2007 and 2014.

“It was a very tight game, a standard Marshwood-Massabesic type game,” Marshwood Coach Bernie Marvin said. “Our unforced turnovers obviously were our downfall … Other than that it was a fun game, an exciting game.”

In their previous meeting in April, Marshwood (13-2) scored two goals in the final 19 seconds for a 5-4 win.

“We gave up in that game and it cost us,” Massabesic Coach Brooks Bowen said. “We vowed that would never happen again.”

This time Marshwood jumped ahead 2-0. Costin fed Smith with 20:55 left in the first half, then Costin scored unassisted 50 seconds later.

“I thought we were a little tight in the early going,” Bowen said. “We had some balls slip through us … We had some adjustments to make defensively. You start out behind 2-0, you know you have a battle the rest of the game.”

Dimastrantonio, who drew the Hawks’ attention all game, got free for a low shot and scored to make it 2-1, then connected again for the tying goal. Marshwood never led again.

Dimastrantonio might have scored more, but Hawks goalie Skyler Amsden made some solid stops among her 11 saves. Massabesic goalie Lydia Wasina made five saves.

Drain bounced in a goal for a 3-2 halftime lead.

Massabesic kept up the attack, helped by Dimastrantonio winning nearly every draw after goals.

After Rowe made it 3-3, Drain bulled her way in and scored twice for a 5-3 lead.

“She brings a lot of intensity,” Dimastrantonio said. “She’s a powerhouse.”

Marshwood didn’t quit. Trailing 6-4, Costin and Nichols scored two minutes apart, tying the game with 3:13 left.

Massabesic got control after the tying goal, and helped by Delia Sylvain, the Mustangs worked the ball around. Then Ring got it.

“I just wanted to help the team,” she said.

After Ring’s goal, the Mustangs won the draw and then kept possession.