MILWAUKEE — Neil Walker put his hands on his knees, doubled over with a look of shock on his face. He couldn’t catch his breath. The Mets second baseman had just been struck square in the chest, near the heart, by a one-hop rocket clocked at 107 mph hit by the Brewers’ Hernan Perez.

The ball trickled to his left, far enough for Kirk Nieuwenhuis to beat Walker’s throw home and cut the Mets’ lead in half. But in what became a 5-2 win over the Brewers on Thursday night, the seventh-inning run was an afterthought.

At a time when every game seemingly costs the Mets something, it was Walker’s health that sent a shiver through the team. Perhaps they caught a lucky break for a change.

“I feel OK,” Walker said after an exam revealed no broken bones. “Obviously, taking a liner like that off the chest, I just felt a little weary afterwards. I didn’t quite feel right. Rather than just get back in there, I felt it best to have the doctor see me as a precautionary measure.”

Manager Terry Collins jogged on the field with trainer Ray Ramirez, fearing that Walker had suffered a broken rib. After lingering on the field for a minute or two, Collins and Ramirez retreated to the dugout and Walker stayed in the game.

advertisement | advertise on newsday

But he felt dizziness in the dugout. The Mets pulled him to be safe, with Matt Reynolds contributing an RBI single in Walker’s place in the ninth.

“I got hit in the meat of my chest,” Walker said. “When you get a ball close to your heart, close to your rib cage there, you just want to make sure that there’s nothing. I didn’t want to go out there and dive or do something that might aggravate more if there was something going on. Fortunately, he didn’t see anything, any issues.”

Ultimately, Walker didn’t require X-rays. He considers himself day-to-day, providing a measure of relief for the Mets, who already are missing David Wright, Lucas Duda and Travis d’Arnaud.

The Mets (33-26) sweated out another victory with their depleted crew, picking up a game on the first-place Nationals.

Bartolo Colon put on a master class in limiting damage, allowing eight hits but holding the Brewers to one run in seven innings. He helped himself by coaxing three timely double plays and ended an inning by picking off Scooter Gennett at first base.

Mets videos

Curtis Granderson, who began the day hitting .203, blasted his 11th homer of the season and his sixth to lead off a game, tying Jose Reyes’ franchise record. Yoenis Cespedes had two hits, including an RBI single, a sign that he might be thawing from a cold snap.

With the Mets leading 2-1 in the eighth, Kevin Plawecki delivered a bases-loaded single past a diving Jonathan Villar at shortstop. The hit drove in James Loney and Asdrubal Cabrera to give the Mets a 4-1 lead.

“I know we’re not swinging hot bats by any means,” said Plawecki, who began the day hitting .200, part of the reason he’s lost playing time to Rene Rivera. “But it’s still good to see that we’re able to keep battling and win some ballgames.”

After the Brewers got a run back in the eighth on Gennett’s RBI double, the Mets answered in the ninth on Reynolds’ pinch-hit single.

The hit drove in Juan Lagares, who entered as a defensive replacement the previous inning and hit for himself in the ninth. It was his first game action since he suffered a partial tear of a ligament in his left thumb while making a diving catch on Saturday.

advertisement | advertise on newsday

Lagares bounced one back through the box, then motored hard around first before sliding headfirst into second, putting himself in position to score.

For one night, rather than adding to the growing ranks of the walking wounded, the Mets actually appeared to regain a piece. For a while, though, that appeared to be a mirage.

Walker, 30, has been a revelation for the Mets. Entering play, he ranked second on the team with an .842 OPS.

A Pittsburgh native, Walker was swarmed during his homecoming against the Pirates, the franchise that drafted and developed him before ultimately trading him away. He had one error this season before committing three in two days against the Pirates.

But despite the sting of taking a rocket off his chest, it appears that Walker may have caught a break, and the Mets went a day without losing another big bat.

advertisement | advertise on newsday

“We don’t need that,” Collins said. “We don’t need more key guys to go down.”