Deiner Lopez drew a bases-loaded walk in the bottom of the 10th inning to lift the Portland Sea Dogs to a 5-4 win over the Bowie Baysox in an Eastern League game Sunday afternoon at Hadlock Field.

The Sea Dogs rallied from an early 3-0 deficit to win the rubber game of the three-game series against the Baltimore Orioles’ Double-A affiliate.

The victory overshadowed a strong performance by Portland native Ryan Flaherty, who is on a rehab assignment, coming back from shoulder tendonitis that shelved him in May. Flaherty, a 2005 Deering High graduate, hit four singles, walked twice and scored three runs for the Baysox.

“That’s better than Ryan,” Flaherty joked after the game. “That’s someone else. I don’t get on (base) that many times. I don’t know who that was today.”

Portland Manager Carlos Febles held a different opinion.

“He’s a big leaguer, and you could tell what he was trying to do at the plate,” Febles said. “I think we got him ready to go back.”

Henry Owens, a lefthander who has spent parts of two seasons with the Boston Red Sox, pitched five innings for the Sea Dogs, allowing three runs on five hits, while striking out seven and walking six.

“Owens made big pitches when he had to,” Febles said. “He kept us in the game.”

For the past six weeks, Owens, who was sent down from Triple-A Pawtucket, has worked on delivering the ball from the three-quarter arm slot rather than over the top.

“It’s starting to feel natural, starting to feel comfortable,” he said. “Now I’m at the point where I need to trust it every pitch.”

The Baysox took a 2-0 lead in the third.

Light-hitting Adrian Marin led off with a wind-aided, opposite-field home run. It was his first homer in nearly a year. Flaherty walked, moved to third on a wild pitch and a groundball before scoring on a bloop single to center by Aderlin Rodriquez.

The Baysox took a 3-0 lead in the fourth. Flaherty dumped an opposite-field, two-out single into left, moved to second on a walk and scored when Garabez Rosa shot a single up the middle.

Mike Olt made it 3-1 in the bottom of the fourth when he hit his 15th homer of the season.

The Sea Dogs closed to within a run when Jordan Procyshen led off the bottom of the fifth with a double into the gap in left, moved to third on a sacrifice bunt by Lopez and scored on Danny Mars’ ground single into left.

The Baysox took a 4-2 lead in the sixth. Flaherty singled with two outs and came around to score when Austin Hays doubled off the right field wall.

The Sea Dogs hit two homers in the sixth to make it 4-4.

Jeremy Barfield extended his hitting streak to 16 games when he led off with his team-high 20th home run, a blast down the line in left.

With two outs, Josh Tobias hit his second homer of the season, a towering shot to left-center.

After the Baysox stranded a total of five runners in the top of the ninth and 10th innings, the Sea Dogs loaded the bases on an error, and singles by Tobias and Procyshen before Lopez capped an eight-pitch at-bat by drawing the decisive walk.

NOTES: Flaherty, who spent Sunday night at his home in Falmouth, was scheduled to fly to Baltimore on Monday. He is unsure what the next step in his rehab will be. “I’m just working along,” he said. “When it’s time, it’s time. (The Orioles) will let me know.” … It was the Sea Dogs’ ninth sellout of the season. Attendence as 7,368.