CAPE ELIZABETH — With the Cape Elizabeth girls’ lacrosse team riding a hot goalie and enjoying most of the second-half momentum, Kennebunk needed a late-game spark Tuesday night.

Gabrielle Fogg provided it, scoring with 58.8 seconds remaining to send Kennebunk to a 6-5 victory in girls’ lacrosse.

“She saw the (one-on-one) open and we’ve really been working on that,” said Kennebunk Coach Annie Barker. “If you see the (one-on-one), you’ve got to go. Sometimes we just weren’t cutting fast enough and the middle wouldn’t be open, and we needed to be more patient.”

Fogg’s goal for the Rams (9-2) came on the heels of a dominant second half by Cape Elizabeth goalie Erin Foley, who finished with eight saves.

“I just dodged and switched to my left, and found the open top corner,” Fogg said. “When I saw it I figured, why not take the shot. I was aiming for non-stick side and my stick was already high. I had girls on me so I couldn’t really try to fake low.”

The goal was especially impressive considering that Foley looked impossible to beat for most of the second half.

She gave Cape a chance to climb back into it after falling behind 4-2 at halftime. Foley turned away three point-blank shots in the final five minutes.

“Every game, I don’t think she could continue to impress me more and she just keeps surprising me,” said Cape Elizabeth Coach Alex Spark. “The saves that she makes are ridiculous. Sometimes she just leaves my jaw hanging down on the sideline. She’s really fun to watch and I’m really glad I have her for two more years.”

Kennebunk took a 4-2 lead into halftime behind two goals from Hallie Schwartzman, and one each from Fogg and Leah Dumas.

Caroline Coburn and Mariah Deschino scored for the Capers (7-5) in the first half.

“We said at halftime, ‘We don’t care about the score, we don’t care if we win or lose, we want you guys coming off the field feeling good about the way you played,’ ” said Spark. “We had girls coming off the field with smiles because of how fun that second half was and that’s all I could ask for as a coach.”

Six minutes into the second half, Dumas made it 5-2. Until the midway point of the half, it looked like Kennebunk might roll to an easy win.

Things changed when Susie Graham stole a pass from the Kennebunk keeper and slipped a shot past her to make it 5-3. Chloe Chaplin and Emily Healey followed with a pair of quick goals to made it 5-5, setting up Fogg’swinner.

“We said ‘don’t mark up on the goalie’ because we wanted to mark up on all of the players,” said Spark. “In the heart of the moment you do whatever you feel is right. Sometimes luck goes your way and the ball just happened to pop up (for Graham) like that. We needed something kind of funny and lighthearted to get us to relax.”