DENVER (AP) — Ryan McMahon turned a small adjustment into a big return for the Colorado Rockies.

McMahon tweaked his swing early in the afternoon and then hit a go-ahead, three-run homer to help rally the Rockies past the New York Mets 10-8 on Wednesday night.

Nolan Arenado and Charlie Blackmon also went deep, and Colorado’s struggling bullpen shut the door in the late innings.

“You need a bullpen to do what ours did tonight from the sixth on — put up zeros,” Rockies manager Bud Black said. “That’s the expectation, and that’s their expectation.”

Colorado trailed 8-6 when McMahon pinch-hit with two on and two outs in the fifth. He sent a 1-0 changeup from reliever Robert Gsellman into the Rockies’ bullpen to give Colorado the lead.

It was McMahon’s second homer of the season and it came just hours after he worked with hitting coach Duane Espy in the batting cage.

“I made a small adjustment today with my hands, just put them in a better position to get that shorter swing off, that flatter swing off,” McMahon said. “Stood the bat up a little more and got instant results.

“It’s been a long time coming and it felt really good to come through for the guys.”

Gsellman (5-2) had given up just one home run in 16 road games prior to Wednesday.

“A changeup right down the middle and the hitter just did his job and hit it out of the ballpark,” he said. “Got to execute the pitch.”

Bryan Shaw (3-5) got one out to earn the win. Wade Davis pitched the ninth for his 21st save this season — and the 100th of his career.

New York took an 8-6 lead with a four-run fifth. The Mets batted around for the second time in the game and benefited from three walks in the inning, including one to Brandon Nimmo with the bases loaded.

Dominic Smith, who tripled in the fifth, had a career-high three hits for New York and was a home run short of the cycle.

The Mets loaded the bases in the sixth against lefty Harrison Musgrave but pinch-hitter Kevin Plawecki grounded into an inning-ending double play to Arenado at third.

“The sixth got a little dicey, but zeros nevertheless,” Black said. “That’s how you win games.”

Neither starter lasted long in another high-scoring game at Coors Field. The Mets scored three in the first and another in the second to take a 4-1 lead, but Colorado tied it with three unearned runs in the second.

The Rockies went ahead 6-4 in the third on RBI singles by Gerardo Parra and Tom Murphy.

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)