Down 3-0 after several squandered chances, the Portland Sea Dogs rallied for four runs in the bottom of the ninth inning Thusday night to shock the New Hampshire Fisher Cats 4-3 at Hadlock Field.

Tzu-Wei Lin singled in Carlos Asuaje with the winning run.

“The last few nights, that last inning has been our inning,” Asuaje said. It was the third walk-off win this week for Portland.

On Tuesday, Lin scored on a wild pitch for the winning run in the bottom of the 10th. On Thursday, Lin stepped up with the bases loaded and two outs. He quickly fell behind 0-2 to reliever Danny Barnes.

“I just wanted to calm down and relax, and look for the fastball,” Lin said.

He fouled off the third pitch. The fourth was the fastball Lin wanted. Lin drove a ball over center fielder Roemon Fields, who was playing in.

The Sea Dogs improved to 36-63. The Fisher Cats dropped to 50-45.

Before the rally, the Sea Dogs had stranded nine runners, eight in scoring position (three on third).

“We kept getting guys on base but nothing was going our way,” said Asuaje, who tripled, walked twice and hit a key double in the ninth.

Reed Gragnani began the rally with a one-out walk. Aneury Tavarez singled and Manuel Margot knocked them both in with a triple that took a bad bounce over Fields’ glove.

Asuaje tied the game, scoring Margot with a bloop double down the left-field line. Barnes relieved Colt Hynes (2-1) and walked Oscar Tejeda.

Barnes then struck out Tim Roberson but walked Henry Ramos to load the bases, setting up Lin’s game-winner.

Sea Dogs reliever Jorge Marban (2-0) got the win. Luis Diaz made his second straight start over six innings, going 6 1/3, allowing three runs on six hits. He has been pitching much better since early struggles, not allowing more than three runs in a game since June 10.

Portland’s offense could do little against New Hampshire starter Jeff Hoffman, 22, the Blue Jays’ first-round (ninth overall) draft pick in 2014. He allowed four hits over 5 1/3 innings.

NOTES: The announced paid attendance was a sellout of 7,368. … Mike Augliera made his first relief appearance with 12/3 scoreless innings. … Former Sea Dogs outfielder Shannon Wilkerson, who played three seasons in Portland before being released this spring, signed with the Minnesota Twins and is playing for Double-A Chattanooga.