Two rare mistakes cost the Cubs.
Anthony Rizzo made a fielding error with two outs in the seventh and Hector Rondon gave up the game-winning home run to pinch-hitter Cody Asche with two outs in the ninth as Chicago lost 7-5 to the Philadelphia Phillies on Saturday night.
Rondon (5-4) got the first two outs of the ninth before walking Erik Kratz. Asche followed in the pitcher's spot and drove the first pitch into the foul pole in right field to help Philadelphia win for just the fifth time in the last 19 games.
Rondon entered having allowed just two earned runs in his last 44 innings dating to May 25.
Philadelphia took a 5-1 lead with five unearned runs with two outs in the seventh.
The trouble started for the Cubs when Andres Blanco hit a routine grounder to first. Rizzo fielded the ball cleanly, but lost control of it when he attempted to throw to first.
"I might have rushed it a little," Rizzo said. "I didn't do a very good job there."
Ryan Howard, mired in a 1-for-36 slump entering play, tied the game with a pinch-hit RBI double to right. The Phillies took the lead when Justin Grimm walked pinch-hitter Darnell Sweeney with the bases loaded, and Cesar Hernandez cleared the bases with a double to left to put Philadelphia up four.
"The guys that have been reliable all year just didn't do it tonight," Cubs manager Joe Maddon said.
But Chicago tied it with four runs in the eighth off struggling relievers Luis Garcia and Jeanmar Gomez.
"No surprise there; we've been doing it all year," Rizzo said.
Garcia started the inning and faced three batters without recording an out and left after Chris Coghlan's two-run double pulled the Cubs to 5-3. Gomez surrendered an RBI double to Kris Bryant and Miguel Montero's sacrifice fly to center that tied the game.
Giles came on and struck out Addison Russell for the final out of the frame.
Ken Giles (6-2) pitched 1 1/3 scoreless innings, striking out three, to earn the win.
Kyle Schwarber hit his third homer in two games, a solo shot in the third for Chicago. The Cubs dropped to three games back of Pittsburgh for the top NL wild-card spot with their second loss in their last nine.
The game was delayed 50 minutes at the start due to rain.