CHICAGO (AP) — Wade Miley pitched seven effective innings, Nick Castellanos homered and the Cincinnati Reds got a sorely needed victory, topping the Chicago Cubs 4-3 on Tuesday night.

Cincinnati had dropped seven of nine to lose ground in the NL playoff race. The Reds began the day one game back of San Diego for the second wild card.

READ MORE: Tony Landers Charged In Attack On Ald. James Cappleman After Alderman Confronted Men Who Were Drinking In Public In Uptown

They rebounded behind Miley (12-5), who was coming off one of his worst performances during an impressive season. The veteran left-hander allowed one run and five hits, struck out eight and walked none.

Miley, tagged for five runs and 12 hits over four innings during a 5-4 loss to the Cardinals last week, improved to 6-1 with a 2.67 ERA in his last 11 starts.

Willson Contreras, Rafael Ortega and Ian Happ homered for Chicago, which had won a season-high seven straight. Happ, who finished with three hits, is batting .367 (33 for 90) in his last 24 games.

The Reds were clinging to a 2-1 lead when they pushed across two runs in the eighth. Jonathan India, who homered in the first, doubled and scored on Mike Moustakas’ two-out single off Manuel Rodríguez. Kyle Farmer tacked on another RBI single.

Ortega and Happ connected in the bottom half against Michael Lorenzen, but Mychal Givens worked the ninth for his sixth save.

Right before Happ’s 20th homer, Farmer robbed Frank Schwindel of a hit when the shortstop made a terrific catch in short center field.

India drove Adrian Sampson’s third pitch into the bleachers in center for his fifth leadoff homer and No. 19 overall in his first big league season. After Tyler Naquin bounced to third, Castellanos connected for his 27th homer.

READ MORE: Man Shot, Killed During Home Invasion In South Shore; 4 People In Custody

India’s homer traveled an estimated 422 feet, and Castellanos’ drive went even further at 446 feet — landing on a green roof in center. But then Sampson (0-2) settled down nicely, allowing six hits over a season-high five innings in his second start of the year.

The Cubs got one back on Contreras’ 18th homer, a two-out drive to left-center in the third. They almost got the tying run in the sixth, but the Reds caught a break.

With two out and Happ on first, Patrick Wisdom’s drive to left-center got lost in the ivy for a ground-rule double. That meant Happ had to go back to third, and Matt Duffy tapped back to Miley for the final out of the inning.

TRAINER’S ROOM

Reds: OF Jesse Winker (intercostal strain) had to slow down for a day or two after he felt “a little something,” according to manager David Bell. But the All-Star slugger could appear in some minor league games within the week. “It’s the last step, really. It’s just being able to swing, take full swings,” Bell said. “That’s a big step with that injury.”

Cubs: RF Jason Heyward was scratched due to right hamstring cramping. Wisdom moved from left field to right with Heyward out, and Alfonso Rivas entered the lineup in left. … OF Michael Hermosillo is dealing with some left forearm soreness. He entered as a pinch-runner in the ninth. … Bench coach Andy Green said INF Nico Hoerner (right oblique strain) is doing well after working out Monday. “He’s still got a few more hurdles to clear before I think the medical staff feels good about him being out in a competitive setting again,” Green said.

UP NEXT

Right-handers Vladimir Gutierrez (9-6, 4.17 ERA) and Alec Mills (6-6, 4.25) pitch Wednesday in the series finale. Gutierrez has dropped his last two starts for Cincinnati, allowing eight earned runs in 6 1/3 innings. Mills is 2-2 with a 3.66 ERA over his last six outings for Chicago.

MORE NEWS: R. Kelly's Attorney Says Singer Unlikely To Testify At His Sex Trafficking Trial

(© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)