CUMBERLAND — Patrick O’Shea hit a two-out single through the left side of the infield to drive in a seventh-inning run and give Greely a 5-4 victory against Yarmouth in a Western Maine Conference baseball game Wednesday.

“I was just trying to get the bat on the ball,” said O’Shea, who brought a premature end to another rally by lining into an inning-ending double play in the fifth. “I wanted to make up for that double play.”

It was a gritty win for Greely (5-1), which scored in the fifth to make it 4-4.

“It’s always good to go through these type of games during the regular season,” Greely Coach Derek Soule said. “Against a rival and in a tight game, where guys had to feel a different kind of pressure than they’re used to, is only going to help us down the stretch. It’s fun to experience those things and have some success fighting through those emotions.”

Early on it looked like Greely would cruise.

Will Bryant, a right-hander with a fastball that topped out at 84 mph, seemed in total command as the Rangers built a 3-1 lead through four innings.

When Bryant, who allowed two hits and struck out six in the first four innings, ran into control problems in the fifth, the Clippers took advantage.

“I threw 88 pitches and that’s the most I’ve thrown this year,” Bryant said. “I could tell I was getting tired out there. I was missing the spots I couldn’t locate and that’s what got me.”

Yarmouth (4-2) scored three runs to take a 4-3 lead.

With one out, Ryan Nason doubled. After Jack Snyder walked, Nason scored on a throwing error by catcher Reid Howland while trying to steal third. Snyder moved to third on a passed ball and scored on a wild pitch to make it 3-3. A walk, a hit batter and Cooper Lainey’s single produced the tie-breaking run.

The Rangers made it 4-4 in the bottom of the inning on Bailey Train’s single and three walks.

Bryant started the winning rally by getting hit by a pitch for the second time in the game. Pinch-runner Corey Brink moved around the bases on grounders by Chaz Reade and Tom Buchholz before coming home on O’Shea’s winning hit.

“It’s definitely going to help us later in the playoffs, a game like this, because we persevered and came through big time and got the win,” Bryant said.

Yarmouth Coach Marc Halstead said the Clippers also should benefit.

“You learn the greatest life lessons out of losing, so we’ll learn better lessons out of this than if we walked out of here with a 10-6 win,” he said. “We’ll be better because of this and that’s why I love this group of kids.”

Mike McDevitt, who slammed a two-run single to stake the Rangers to a 2-0 lead in the second, pitched two innings of two-hit relief to record his first win.