For most of this season, the Mets’ offense has been boom or bust, either powered by home runs or dormant. Given his team’s recent struggles at the plate, manager Terry Collins nearly broke out laughing before Saturday’s game when he was asked if the Mets need to “manufacture” more runs.

“That’s not how we’re built,” Collins said.

But when they had to have it in a tie game Saturday at Citi Field, the Mets managed to cap a comeback from a three-run deficit by putting on their hardhats and grinding out a run the hard way against Brewers reliever Michael Blazek.

And wouldn’t you know it, the guy who produced the game-winning, bases-loaded single in a 5-4 victory was captain David Wright, whose bat had gone bust recently as he fought back problems.

Eric Campbell started the bottom of the ninth with a single off Blazek, who then walked Kevin Plawecki. That brought up pinch hitter Matt Reynolds, who got down a perfect two-strike bunt to send the runners to second and third. Blazek walked leadoff man Curtis Granderson (.197 average), to load the bases for Wright, who was 5-for-41 in a 13-game span before driving a 3-and-0 pitch into the right-centerfield gap.

There was no mistaking the outpouring of emotion as Wright’s teammates celebrated his success. “[Yoenis] Cespedes beat me down to first base [from the on-deck circle] by quite a bit,” Wright said. “I could see him yelling and jumping halfway down. That was really cool. The way the guys reacted made me feel good because I’ve been struggling. It seems like those situations find you when you’re not feeling your best at the plate.”

advertisement | advertise on newsday

Of course, a walk in that spot would have won the game, too, but a hit by Wright was so much more dramatic. Collins said he would have given Wright the green light to hit in that situation, but the captain never looked over to him.

“I didn’t want to look in case he didn’t give it,” Wright said with a smile. “I learned a long time ago it’s better to ask for forgiveness than permission. I’m just glad that ball found some open space and I didn’t hit a hard one-hopper at somebody.”

It was Wright’s ninth career walk-off RBI, a franchise record, and his first since July 5, 2012, in Philadelphia. No one was happier for Wright than Collins, who has kept him in the No. 2 spot in the lineup even as his average has plummeted to .223.

“He’s such a smart player,” Collins said. “I know his strikeouts are up, but you saw him hold off the sliders early in the count. He had an idea what he was going to get, and when 3-0 found him, I’m sure he was thinking opposite way.”

The first eight innings were more typical of this season for the Mets. Granderson led off the game with a home run to rightfield on the second pitch, his second leadoff homer in the past five games. But starting pitcher Jacob deGrom had a shaky five innings in which he gave up four runs, including a two-run homer by Ramon Flores in the second inning.

Mets videos

DeGrom was taken off the hook in the sixth inning when Cespedes hit a two-run homer on a low changeup from Brewers starter Zach Davis. The drive went just inside the leftfield foul pole and tied the score at 4.

Relievers Hansel Robles, Addison Reed and Jeurys Familia (1-0) then kept the Brewers at bay for four innings until Wright could deliver in the clutch.

“We put together some really good at-bats in that inning,” he said. “Everybody knows when we hit homers, we score runs, and we’ve found it hard at times to be a good situation-hitting team. If the guy in front of you doesn’t get it done, you get it done. That’s the mentality we had toward the end of [last] year, and that’s what I think we can do moving forward.”