Cole Hamels pitched six innings for his first win in two months, leading the Chicago Cubs to a 5-3 victory over the San Francisco Giants.
Anthony Rizzo homered twice for Chicago, and Nicholas Castellanos also went deep. Jonathan Lucroy contributed a key run-scoring single after Chicago won a replay challenge.
The Cubs (67-58) earned their third straight win and stayed a half-game back of NL Central-leading St. Louis, which posted a 9-4 win over Milwaukee.
Hamels (7-4) permitted three runs and five hits in his first win since June 12 at Colorado. The left-hander went 0-2 with a 6.12 ERA in his previous six starts, including a shaky performance at Philadelphia last week.
San Francisco dropped to 3-2 on a nine-game trip. Austin Slater hit a two-run homer for the Giants (63-63), and Kevin Pillar added a solo drive.
Kyle Ryan and Rowan Wick each got three outs before Craig Kimbrel finished for his 10th save in 12 chances. It was Kimbrel's first save opportunity since he returned Sunday after being sidelined by right knee inflammation.
Rizzo went 3 for 3 and scored three times in his first multihomer game this season. Castellanos hit his seventh homer in 18 games since he was acquired in a July 31 trade with Detroit.
Right-handers Dereck Rodriguez and Yu Darvish pitch Wednesday night.