DENVER (AP) Jordy Mercer broke out of a slump and helped the Pittsburgh Pirates edge closer to another playoff berth.

Mercer had four hits and drove in two runs, Starling Marte homered among his four hits and came within a triple of the cycle, and Pittsburgh beat the Colorado Rockies 9-3 on Monday night.

Aramis Ramirez also went deep for the Pirates, who reduced their magic number for clinching a postseason berth to two. A win Tuesday and a San Francisco loss would clinch at least a wild card for the third consecutive year.

More from FoxSports

Pittsburgh became the second team to reach 90 wins this season with Monday's victory. Only the division-rival Cardinals have more victories.

''It's an organizational win,'' manager Clint Hurdle said.

Mercer spent more than a month on the disabled list with a sprained left MCL and has struggled since returning Aug. 23. He was hitting .222 in 23 games before tying his career high in hits against the Rockies.

He hit doubles in the second and fourth innings to drive in Francisco Cervelli, who had three hits, as the Pirates built a 5-0 lead on Jon Gray (0-2).

''I've had struggles with it being the first time on the DL,'' Mercer said. ''I took four and a half, five weeks off. I wanted to get results right away but it takes time.''

Mercer singled and scored in the sixth and added another single in the ninth.

''He's been doing a better job of managing his at-bats for a while,'' Hurdle said of Mercer. ''He's getting back up to speed and those first two swings were big for us.''

Marte didn't waste any time getting going against Gray. He homered in Pittsburgh's two-run first, singled in the fourth and doubled off the top of the wall in the sixth. He led off the ninth with a single to center.

Gray allowed nine of Pittsburgh's 15 hits. The rookie right-hander is still searching for his first major league win after nine starts.

''Early on he struggled to get the ball down,'' Rockies manager Walt Weiss. ''That first inning, it's always an inning of vulnerability.''

Pittsburgh starter A.J. Burnett cruised through the first four innings before an error on a potential double-play ball in the fifth preceded Tom Murphy's three-run homer that made it 5-3.

Burnett (9-5) then hit a batter and walked two more to load the bases before striking out Nolan Arenado to end the inning.

''He dealt up until the fifth,'' Hurdle said. ''We weren't able to put the double-play ball away and tacked on 18 more pitches. I think the fatigue of the inning took something away from him. He threw 30 pitches that inning.''

The Rockies again loaded the bases against Burnett in the sixth inning but Antonio Bastardo came on and got DJ LeMahieu to line out to second.

Ramirez added an RBI single during Pittsburgh's three-run ninth.

STOLEN MOMENT

Colorado's Charlie Blackmon swiped second and third on consecutive pitches in the fifth inning to reach 40 steals. He is the fourth Rockie to have 40 or more steals and the first since Willy Taveras had 68 in 2008.

''He's always run pretty well but he's done a nice job of preparing every night to steal bases'' Weiss said. '' Forty stolen bases is a lot in this day and age.''

TRAINER'S ROOM

Pirates: The Pirates placed INF Jung Ho Kang on the 60-day DL. Kang underwent surgery Thursday night to repair a broken left leg and torn knee ligament sustained on a takeout slide at second base by Chris Coghlan of the Chicago Cubs.

Rockies: LHP Jorge De La Rosa (right Achilles' tendinitis) was scratched from his start Wednesday. RHP Christian Bergman will take his spot in the rotation. ... LHP Yohan Flande is progressing and may not miss his scheduled start Friday. Flande left Saturday's game in the fourth inning after taking a line drive off his left knee.

UP NEXT

Pirates: LHP J.A. Happ (5-2) will try to continue his mastery over Colorado. He is 2-0 with a 1.86 ERA in five games - four starts - against the Rockies.

Rockies: LHP Chris Rusin (5-8) has pitched complete games in two of his last three Coors Field starts. He shut out San Diego on Aug. 16 and beat San Francisco 11-3 on Sept. 3.