CHICAGO (AP) — Pedro Alvarez hit a three-run homer to cap a five-run seventh inning and Jason Grilli retired Emilio Bonifacio on a bases-loaded grounder to end the game, giving the Pittsburgh Pirates a 5-4 victory over the Chicago Cubs on Thursday.

The Pirates trailed 4-0 heading into the seventh, but two big drives changed things.

READ MORE: Watchdog Report Says CPD Has Taken Few Steps To Fix Problems With Records Management In Court Cases

Pinch hitter Travis Snider cut the deficit in half with a two-run homer off Brian Schlitter. Alvarez put Pittsburgh ahead with his three-run drive against James Russell (0-1).

READ MORE: 860 Afghan Refugees Coming To Illinois From First Wave Of Resettlement

Chicago threatened in the bottom of the ninth before Grilli retired Bonifacio on a grounder to first. The Pirates took two of three at Wrigley Field.

That gave the Pirates their third series win — the most for them to start the season since the 1992 team took its first six.

MORE NEWS: Construction Begins On Affordable Housing In Chicago's Pilsen Neighborhood

Copyright 2014 by The Associated Press. Any commercial use or distribution without the express written consent of The Associated Press is strictly prohibited.