Updated

Pedro Alvarez gave the Pittsburgh Pirates a chance with one dramatic swing in the ninth inning. Only this time, the surprising NL Central contenders fell short.

Alvarez hit a tying three-run homer, but Dexter Fowler hit a winning sacrifice fly off Jason Grilli in the bottom half to lift the Colorado Rockies to a 5-4 victory on Monday night.

Neil Walker had three hits and Andrew McCutchen added two more for the Pirates, who have lost three of four since the All-Star break. They remained one game back of division-leading Cincinnati, which lost 5-3 to Arizona.

Wilin Rosario led off the ninth with a single against Grilli (1-3) and moved to third on a one-out single by pinch-hitter Jason Giambi. Fowler hit a deep fly to McCutchen in center field and Rosario slid home ahead of the throw.

"Pedro gave us a chance to get back in it and (I) just didn't do what I wanted to do out there, that's all," said Grilli, who entered with a 1.82 ERA in 36 games. "Some days you're the hero; some days you're the goat, man. I can't let his affect me. It's not going to affect me.

"Things have been going good. It's kind of weird to have a night like this. It stings pretty good. But I'll bounce back. Made some pitches, left them up and they did what they're supposed to do with it."

Intermittent rain, heavy at times, fell throughout the night and finally prompted a 53-minute rain delay with one out in the top of the ninth and Colorado leading 4-1. McCutchen and Walker singled off closer Rafael Betancourt, and with Alvarez at the plate the tarp was brought out.

After play resumed, Alvarez hit reliever Rex Brothers' first pitch, a 98 mph fastball, into the left-field seats.

"It's just tough because you got to sit down for so long and resume play like nothing happened," Alvarez said. "You got the adrenaline going before the rain delay and you just get kind of stagnant. We deal with it all the time; we're used to it."

Alvarez said he "was just trying to get on base" and pounced on a fastball that "was over the plate."

Brothers (5-2) got the win despite serving up the tying home run.

Jeff Karstens allowed four runs — all in the fifth — and six hits in seven innings for Pittsburgh. He also drove in the first run of the game with two out in the fifth when he came up with runners on first and third and bounced a single over the head of first baseman Michael Cuddyer.

"I was trying to see the ball deep, and hit it the other way," said Karstens, who had two RBIs in his previous 130 career at-bats. "I got lucky. I was like, 'I hope he can't jump.'"

Karstens extended his scoreless streak to 16 innings before the Rockies grabbed the lead in the fifth. Karstens walked leadoff hitter Tyler Colvin.

"I tried to get a guy to chase on a ball that was down, and he didn't chase," Karstens said.

With Colvin running, Rosario grounded a single through the area vacated by second baseman Walker, and Colvin went to third. Josh Rutledge singled home a run, and pinch-hitter Eric Young Jr. doubled home two runs. Marco Scutaro's two-out single scored Young to make it 4-1.

Karstens had no trouble in the sixth or seventh and left after throwing 101 pitches, 67 strikes.

Josh Roenicke pitched three scoreless innings in relief of Francis and turned the game over to Betancourt, who threw six pitches to three batters but never got the chance to work out of trouble because of the rain delay.

"For the fans that stuck around, that was a pretty exciting last 20 minutes," Pirates manager Clint Hurdle said. "I was very happy with the battle back. You never know what's going to happen."

NOTES: The Rockies said INF Chris Nelson was admitted to a hospital to undergo tests for an irregular heartbeat and will remain hospitalized overnight. ... The Pirates activated OF Alex Presley from the seven-day concussion disabled list and optioned first baseman Matt Hague to Triple-A Indianapolis. ... Rockies RHP Juan Nicasio had surgery on his left knee and will likely miss the rest of the season. ... Walker extended his hitting streak to 16 games. ... The Pirates will send LHP Erik Bedard (4-10) to the mound against Rockies LHP Christian Friedrich (5-6) on Tuesday.