One starting pitcher entered the game with an ERA of 7.81.

The other’s was even higher.

So naturally, Kevin McAvoy of Portland and Conner Greene of New Hampshire hooked up in a pitchers’ duel on a warm Friday night at Hadlock Field.

It was McAvoy who came out on top with a 3-2 victory for the Sea Dogs, with defensive help from first baseman Nate Freiman and a redemptive hitting performance from Cole Sturgeon.

“My off-speed was better tonight,” said McAvoy (6-4), who departed after a one-out RBI double by Emilio Guerrero in the seventh cut Portland’s lead to one. “I was a little inconsistent with my fastball location, missing down, but I got them off balance with my off-speed, which made my fastball more effective.”

Because of tightness in his back, Freiman hadn’t played since July 5. He made an immediate impact, lofting a sacrifice fly to deep center in the first to score Yoan Moncada for a 1-0 lead, then stranding a runner at third in both the second and third innings by moving sharply to his right to snare hard-hit grounders.

“He made some really nice plays,” McAvoy said of the 6-foot-8 Freiman. “When he lays out, he covers the hole.”

Freiman also had two hits, which helped the Sea Dogs load the bases with one out in the fourth and again with none out in the sixth.

The first threat evaporated when Greene (1-2) induced Sturgeon to ground into a double play.

But the second time, Sturgeon delivered a tie-breaking two-run, two-out single to right-center to put Portland ahead 3-1.

“The first time, I was a little tentative,” Sturgeon said. “The second time, I just wanted to be aggressive and make sure I got my best swing off.”

McAvoy (six hits, two walks, one strikeout) gave way to left-handed Jake Drehoff, who prevented the inherited runner from scoring and proceeded to pitch a perfect eighth. Ben Taylor earned his first save with a flawless ninth that included two strikeouts.

“That was a great job out of our staff,” Freiman said. “Mac pitched great. Dre came in and left the tying run on base.

“We’re going to win a lot of games when our pitchers give us that kind of effort.”

Aneury Tavarez had three hits for the Sea Dogs. Ex-Sea Dog Ryan Lavarnway caught for New Hampshire and made it 1-1 in the third by grounding into a bases-loaded double play.

NOTES: The announced paid attendance was 5,315. … Right-handed pitcher Keith Couch returned to Triple-A Pawtucket. After opening the season with the PawSox, Couch came down to Portland and went 6-4 with a 3.57 ERA in 11 starts that included three complete games. … Manager Carlos Febles said Jacob Dahlstrand, a 10th-round pick of the Red Sox in 2010, will make his Double-A debut Saturday night. The pitcher has been in Portland since the All-Star break ended. … Saturday’s 6 p.m. game marks the first of two Bark in the Park promotions that welcome dogs to Hadlock. The Sea Dogs also will wear special jerseys featuring mascot Slugger for an in-game raffle to raise money for the Muscular Dystrophy Association. … John O’Hurley, the actor born in Kittery who played J. Peterman on television’s “Seinfeld,” delivered a terrific rendition of “God Bless America” with an arm draped over his son, Will, who also suited up to catch O’Hurley’s first pitch.