Arizona got a two-run homer from Justin Upton in an 8-3 win over Chicago on Friday, but it was a bittersweet victory.
Arizona was knocked out of postseason contention for the fourth time in the past five seasons after St. Louis defeated Washington earlier on Friday.
"It didn't work out the way we wanted to," Diamondbacks manager Kirk Gibson said of his team's season. "I think we did it the right way. We weren't good enough."
Adam Eaton went 3-for-4 with an RBI and a run scored while Cody Ransom added a solo shot for the Diamondbacks, who had dropped three of four coming into play on Friday.
Ian Kennedy (15-11) won his fourth straight decision as he gave up three runs on four hits with six walks and five strikeouts in 5 2/3 innings.
Dave Sappelt hit a two-run home run and Starlin Castro drove in a run for the Cubs, who have lost 10 of their last 11. Travis Wood (6-13) took the loss after giving up five runs on five hits with three walks in five innings.
Arizona struck in the first inning on back-to-back doubles by Eaton and A.J. Pollock and Ransom hit a solo home run in the fourth for a 2-0 lead.
The Cubs tied the game in the fifth as David DeJesus walked with two outs and Sappelt followed with his second home run of the year -- a shot to left.
In the bottom of the frame, though, the Diamondbacks took the lead back.
Kennedy led off with a walk and moved to second on Eaton's sacrifice bunt. Two batters later, Aaron Hill doubled Kennedy home and Upton followed with his 20th homer of the season for a 5-2 advantage.
Chicago got one back in the sixth as Alfonso Soriano led off with a walk and scored on Castro's double to make it a 5-3 game.
The Diamondbacks sealed the win with a three-run eighth. Hill started the inning with a double and scored when Upton hit a single that saw a bad throw by Darwin Barney, his first error in 141 games. Run-scoring singles from Josh McDonald and Eaton later in the frame made it an 8-3 game.
"It had to end at some point," said Barney. "It's a funny game."
Barney tied the single-season record for second baseman with his 141 games without an error. Detroit's Placido Polanco originally established the record in 2007 ... The Cubs are two losses away from their first 100-loss season since 1956 when they went 59-103 ... Chicago stranded nine men on base ... The Cubs set a franchise record with their 57th road loss of the season and are 0-17 on the road against the NL West this season.