ERIE, Pa. — The Portland bullpen put in four solid innings to allow its offense to rally from a seven-run deficit.

But Erie’s Steven Moya quickly erased that impressive work by driving a 2-0 pitch over the right-field wall in the bottom of the ninth inning to give the SeaWolves an 8-7 walk-off win Monday night in front of 4,219 fans at Jerry Uht Park.

“(Mike) McCarthy came in and did a really good job of bridging us deep into the ballgame and Robby Scott pitched a good first inning then the walkoff occurred,” Portland Manager Billy McMillon said.

“I can’t say enough about McCarthy stopping the bleeding and giving us a chance.”

Erie (30-38) started hot and kept tacking on runs in the first four innings.

With two outs in the first, Devon Travis walked before consecutive singles by Steven Moya and Ramon Cabrera gave the SeaWolves a 1-0 lead.

Dixon Machado had an RBI double in the second and Jamie Johnson and Travis each had run-scoring singles as Erie led 4-0.

Johnson started the fourth with a triple and scored on a Jason Krizan fly ball to left. Travis followed with a double and scored on a Moya single.

Cabrera then doubled down the left field line to make it 7-0 Erie and chase Portland starting pitcher Keith Couch.

It was the most runs Couch has allowed in a Double-A start and the first time he’s allowed seven runs since July 7, 2012 as a member of the Salem Red Sox, the High-A affiliate of the Boston Red Sox.

McCarthy came in to throw 32/3 scoreless innings before Scott pitched a scoreless eighth to keep the Sea Dogs in the game.

Portland (44-24) stormed back in the top of the fifth inning with two outs. Heiker Meneses started a five-run rally with a walk before Jonathan Roof singled to left.

Deven Marrero followed with an infield single up the middle that Travis knocked down to seemingly save a run.

Meneses slid around the tag by Cabrera at the plate to get the Sea Dogs on the scoreboard. Cabrera then tried to throw out Roof going to third, but his throw went down the line, allowing Roof to score and Marrero to end up on third base.

Highly regarded prospect Blake Swihart then hammered a 2-2 pitch over the right field wall and Sean Coyle crushed a 3-2 pitch to deep left center to cut the deficit to 7-5 and chase starting pitcher Jeff Ferrell.

In the seventh inning, Portland completed the rally as Roof homered to left and Marrero tripled to right as Moya overran the fly ball down the right field line.

Marrero eventually scored on a sacrifice fly to left to tie the game at 7-7.

“There’s 27 outs in this game so I don’t think the guys on our team give up,” McMillon said. “The character of this ballclub is deep and it’s not out of the realm of possibility that we could still be playing right now. The guys did a great job.”

Erie and Portland will continue the three-game series tonight at 7:05 p.m. before their final meeting of the season on Wednesday at 12:05 p.m.