GORHAM — When Gorham was awarded a free kick about 35 yards from the goal with five minutes left in the first half of its Class A South girls’ soccer semifinal Monday, Falmouth’s defenders marked their players.

But Jenna Cowan saw an opening, and that’s all she needed. Narissa Libby sent the ball toward the left side of the goal, and Cowan slipped through and finished it for a 1-0 lead.

Tiril Wiig added a goal in the closing seconds to clinch a 2-0 win for top-seeded Gorham (15-0-1), which will host the regional final Wednesday against No. 2 Scarborough (12-2-2). The two teams met once this year, on Sept. 14, and played to a 0-0 tie.

No. 4 Falmouth is finished at 11-5, its winning streak stopped at eight games.

“After we settled in, I thought we controlled possession,” Falmouth Coach Andrew Pelletier said. “But you can’t make a mistake on that set piece. We didn’t defend it well enough.”

When Libby sent the ball toward the goal, her teammates rushed toward it. Cowan, a senior midfielder and co-captain, got free.

“I just happened to get a foot on it and it rolled right in,” Cowan said. “It wasn’t too spectacular, but it paid off.”

Maybe the shot wasn’t dynamic, but the positioning was.

“Jenna Cowan doesn’t get a lot of attention,” Gorham Coach Jeanne Zarrilli said, “but she sneaks into little spaces and little holes. And that was a Jenna Cowan specialty goal.”

The goal meant two things: Gorham led 1-0 at halftime, and Falmouth would have to pick up its pace.

“They have really good forwards and their attack is really strong,” Zarrilli said. “I thought my defense stepped up big.”

Falmouth’s Lucy Mahoney and Mia Cooney kept the pressure on, but Gorham was bolstered by a strong defensive group headed by Libby and Avery Germond, a sophomore who manned the sweeper position like a four-year veteran.

“She did a phenomenal job,” Zarrilli said.

Falmouth’s best chances came on balls sent into the box. But Gorham keeper Emma Smith (nine saves) aggressively charged out and stifled the threats.

“Emma’s the best goalkeeper in the state,” Pelletier said. “We knew we would have to make her work. I thought we did a much better job in the second half.”

The Yachtsmen had a couple corner kicks with 11 minutes left. The Rams headed out one chance, and Smith slapped away another.

With seven minutes left, Mahoney won a ball and passed to Madison Wolfe on the wing. She crossed to Lauren Wendland, but Smith got there at the same time, preventing a shot.

“They came at us and we just had to stay composed,” Cowan said.

With Falmouth pressing the attack, Gorham was able to counter. Hallie Shiers and Alexis Fotter created chances, but the Yachtsmen also played strong defense, led by back Meg Dye.

With time running out, Emma Forgues and Wiig led a Gorham counterattack, and Wiig scored with 15 seconds left.

Now Gorham and Scarborough meet in a rematch of their 2015 semifinal, which Gorham won 2-1 on its way to the regional title.

CORRECTION: This story was updated on Nov. 1 at 9 a.m. to correctly identify Gorham soccer player Alexis Fotter.