GRAY — Cape Elizabeth shook off a shaky first inning Thursday and rolled to a 5-1 victory against Gray-New Gloucester in a Western Maine Conference baseball game.

Gray-New Gloucester’s leadoff hitter, Jake Winchester, reached on an error by the shortstop, and the Patriots took advantage to manufacture a first-inning run.

But the Capers came back, responding with a three-run second inning.

With runners on second and third and one out for Cape Elizabeth in the second, Jameson Bakke hit a sharp grounder to short.

Ryan Weare lingered too long in the baseline between third and home, getting into a rundown. It looked like Cape Elizabeth would pay for its baserunning error when pitcher Zach Mann slapped a tag on Weare.

Yet just as the umpire was calling Weare out, the ball jarred loose and Cape Elizabeth managed to tie the game at 1-1.

The Capers further capitalized on that break later in the inning, scoring two more runs on a double to center by their leadoff hitter, Brett McAlister.

Pitcher Marshall Peterson made sure that Cape Elizabeth kept that lead.

Peterson allowed one hit in six innings, striking out 10 and walking two.

Five of those strikeouts were looking, with Peterson frustrating the Patriots with stellar control and a sharp breaking ball.

“Coming into this game, my off-speed stuff hadn’t really been working well the whole season, but today it was definitely on,” Peterson said.

“I think the warm weather helped my arm loosen up and I was feeling better.”

The Patriots added an unearned run in the third. Peterson reached on an error by the third baseman and later scored on a two-out RBI single by Finn Bowe.

Though Mann recovered to shut down the Capers in the fourth, fifth, and sixth innings, catcher Brendan Tinsman struck a powerful final blow in the seventh.

Tinsman, who has committed to play for Wake Forest, drilled a fastball over the fence in left-center field to extend the Cape Elizabeth lead to 5-1.

Coach Andrew Wood took Peterson out for the final inning, handing the ball to Sean Agrodnia. The Patriots did manage their second hit of the day off Agrodnia but couldn’t mount a serious rally.

Wood was pleased with Peterson’s performance.

“I liked that he threw a lot of strikes. It was kind of discouraging that the first batter of the game reached on an error, but he did well just throwing strikes and pitching to contact. He’s been our ace for the past couple years and he helped us get a nice win today when we definitely needed it.”

The Capers moved to 6-4 and Patriots fell to 4-7.

Gray-New Gloucester’s next game is at home against Freeport on Saturday. Cape Elizabeth will be at home against Greely (8-3) on Monday.