SOUTH PORTLAND — Everyone knew coming into the season that Gorham High’s girls’ basketball team had talent. Friday night, the Rams showed some mental toughness as well.

Playing without standout guard Emily Esposito and trailing by 15 points early in the second half, Gorham fought back with relentless defense to surge past South Portland 40-38 at Beal Gymnasium.

Freshman center Mackenzie Holmes scored 10 of her 13 points in the third quarter and the Rams held South Portland to seven points over the final 14 minutes and 45 seconds.

“I’m hoping that we’re going to be able to look back on this game (later) in the season and really start to think that this was the time that we developed some toughness,” said Gorham Coach Laughn Berthiaume.

The victory lifted Gorham to 3-0, while South Portland dropped to 1-2.

Gorham’s defense completely rattled the Red Riots in the second half. South Portland committed just four turnovers in the first two quarters, but 12 in the last two.

After racing out to a 29-16 halftime lead by scoring six unanswered points in the final 30 seconds of the first half, the Riots made just two baskets in the second half.

“It was us not reacting to what they were trying to take away from us,” said South Portland Coach Lynne Hasson. “We became stagnant and lost all our positive energy.”

Two foul shots by Maddie Hasson gave South Portland a 31-16 lead with 6:45 left in the third. Then Gorham took over.

A short jumper by Holmes was followed by a South Portland turnover, then a jumper by Michelle Rowe. Holmes hit two foul shots, then converted consecutive three-point plays – both on lob passes from Danasia Fennie on the right – to bring Gorham within 31-28.

“Those baskets from Holmes got them back in the game and we couldn’t seem to regain the momentum,” said Lynne Hasson.

Holmes said the Rams knew they could get back into it. “It wasn’t like we weren’t working hard, we just weren’t connecting,” she said of the first half. “We wanted to just go out there and work our hardest, and that’s what we did.”

Sarah Boles regained a little momentum for the Riots when she hit a 3-pointer to make it 34-28. But Fennie (12 points) scored the final six points of the quarter to tie it going into the fourth.

Gorham didn’t lead until 2:12 remained when Holmes hit a foul shot for a 37-36 advantage. After a South Portland turnover, Fennie’s jumper dropped in – hitting the back of the rim, going straight up and then straight down through the net, for a 39-36 lead with 1:30 left.

“They call that the shooter’s touch,” said Berthiaume.

Maddie Hasson hit two foul shots to bring the Riots within one. But Michelle Rowe hit a foul shot for Gorham with 11 seconds left. Then Holmes blocked Hasson from behind to stop South Portland’s last bid with three seconds left.

Gorham won it despite being without Esposito, a junior All-State guard. She injured her right wrist in Gorham’s win over Scarborough on Tuesday.

“Any time you take a player of her talent off the floor, it doesn’t make you better,” said Berthiaume. “We had to weather the storm a little bit.”