Travis Snider already had put his helmet back in the dugout when he felt a tug from behind.

The crowd was beckoning him back on the field, and teammate Neil Walker was pushing him onto the dugout steps for his first career curtain call.

"I actually grabbed the wrong helmet because I was kind of caught off guard," Snider said. "I had to grab Gaby [Sanchez's] and run up there just to make sure I had something in my hand. I didn't really know what I was supposed to do."

Forgive Snider if he was unsure of the protocol -- it was his first grand slam. But the timing could not have been better as it ignited a sluggish Pirates offense and triggered 5-4 victory against the Chicago Cubs at PNC Park.

"Wow," manager Clint Hurdle said. "Pinch-hit grand slam, those don't happen every day."

It had been more than 1,000 days since the Pirates' previous pinch-hit slam by Jason Michaels came June 8, 2008, against the St. Louis Cardinals at Busch Stadium. With two outs and the bases loaded, Snider smacked a 2-1 changeup from Chicago reliever Shawn Camp over the right-center field wall -- just barely.

"I knew it was close," Snider said. "I had to watch and see. Luckily, it was a couple feel over, if that."

The grand slam put the exclamation mark on an 11-batter, five-run, sixth-inning uprising before which the Pirates had just one hit.

The Cubs had the go-ahead run on in the ninth when slugger Anthony Rizzo stepped to the plate. But Jason Grilli struck out his former Team Italy teammate to end the game and earn his league-leading 18th save this season.

Grilli had surrendered his third earned run this season earlier in the inning.

Chicago starter Matt Garza cruised in his season debut, pitching five scoreless innings. He allowed one hit, struck out five and walked three after missing most of the first two months with a lat strain. He missed most of the second half of 2012 with elbow soreness.

Cubs manager Dale Sveum said before the game that Garza would be on an 85-90 pitch limit after throwing 75 in his longest rehabilitation outing. He finished with 82 with 49 for strikes in his first outing since July 21, 2012.

The Pirates attacked a shaky Chicago bullpen after Garza left the game.

They loaded the bases in the sixth before Pedro Alvarez drew a bases-loaded, full-count, check-swing walk to score Walker and cut the Cubs' lead, 3-1.