Ross Ohlendorf and Chris Leroux got the Pirates through the first six innings (thanks mostly to Leroux, who bailed Ohlendorf out big-time in the fifth), after which they were tied with Casey Coleman and the Cubs, 3-3. In the bottom of the seventh, though, Daniel McCutchen allowed the first four men he faced to reach base, with two of them scoring on a double by Alfonso Soriano.
The game then went into a long rain delay. It would have certainly seemed reasonable to call the game right there - it wasn't a game with playoff implications, and most sports fans were more fixated on the start of college football season than on baseball anyway. But the game did eventually resume, with Chris Resop taking the mound down two runs with no outs and two men on base.
Resop got the Cubs 1-2-3 to limit the damage, and then kept them off the board in the eighth as well.
At that point, the Cubs turned to Carlos Marmol, who allowed that crazy three-run eighth-inning home run to Michael McKenry back in July. Marmol allowed three runners to reach base, and Derrek Lee - who had just returned from an injury - deposited a ball in Wrigley's left-field bleachers to send the Pirates up 7-5. Joel Hanrahan pitched the ninth to shut it down.
It was a very surprising victory, given the timing of the rain delay, the game situation at the time, and the Pirates' offense's general problems scoring. But hey - that's why we watch the games.
For more on the Pirates, check out Bucs Dugout.