With three games remaining in the regular season for each team, the Pirates trail division-leading St. Louis by three games.

The Pirates, who already have clinched a playoff spot, hold a one-game lead over Cincinnati for the first wild-card slot. Pittsburgh and the Reds finish up with a three-game set in Cincinnati this weekend.

McDonald had three hits, including his homer in the sixth inning that put the Cubs ahead 4-1.

Jake Arrieta (4-2) allowed one run and four hits for the Cubs. Kevin Gregg allowed an unearned run in the ninth for his 33rd save. Francisco Liriano (16-8) allowed four runs and eight hits in five innings. He struck out eight and walked one.

The Cubs took a 1-0 lead in the first inning. Darwin Barney hit a one-out double and scored on a single by Anthony Rizzo.

The Pirates tied it in the third when Justin Morneau walked with the bases loaded to score Starling Marte. Arrieta avoided a bigger inning by getting the next batter, Garrett Jones, to ground out.

The Pirates wasted other scoring chances. They had a runner on second with two outs in the fifth. Morneau hit a leadoff double in the sixth and advanced to third with out, but was stranded when Pedro Alvarez grounded out and Tony Sanchez struck out.

The Cubs came through in the sixth. Donnie Murphy singled and Junior Lake walked, McDonald then hit a 2-1 pitch from Liriano halfway up the bleachers in left-center for his first homer of the season and a 4-1 lead.

NOTES: Dale Sveum doesn't know if he'll be coming back for a third season as manager of the Cubs. Sveum is under contract to return for 2014, but team president Theo Epstein has said all jobs will be evaluated after another losing season. "I'm not going to sit here and lie that you're not wondering what's going to happen in four to five days from now. That's just human nature," Sveum said Wednesday before the game. Sveum expects to hear about his future shortly after the season ends Sunday. "That's part of the gig," he said, "is knowing the day after the season." ... Pirates leadoff hitter Starling Marte had three stolen bases in the game to become the first Pirate with three steals in a game since Andrew McCutchen on June 15, 2010. The Cubs are off Thursday before opening a three-game series Friday in St. Louis with LHP Travis Wood (9-11) facing RHP Lance Lynn (14-10). The Pirates also are off on Thursday before opening a big series in Cincinnati. RHP A.J. Burnett (9-11) takes on Homer Bailey (11-11) on Friday.

Pittsburgh police say they used evidence lifted from Mocospace after the suspect uploaded acts to the site. The girl told police that he knew she was only 13 and that he would stalk and harass her, waiting for her to get off the school bus.