Cubs beat Pirates 8-2 for their 3rd straight win after putting Jose Quintana back on the injured list.

Kyle Hendricks rebounded from a rough outing in Cincinnati and Javier Baez hit a three-run home run as the Chicago Cubs beat the Pittsburgh Pirates 8-2 on Wednesday night at PNC Park.

The Cubs won their third straight on the road trip and moved four games ahead of the second-place St. Louis Cardinals, who come to Wrigley Field on Friday for a crucial five-game series.

Hendricks allowed one run on six hits and two walks over six innings, improving to 4-4. He has a 9.58 ERA in two starts this season at Cincinnati’s Great American Ball Park and a 2.27 ERA in his other six starts.

After serving up a second-inning home run to Colin Moran that wound up in the Allegheny River, Hendricks cruised through the rest of his outing, tying Bill Hands’ franchise record of 37 straight starts with two or fewer walks. Hands set the record from Sept. 11, 1967, to April 13, 1969.

The Cubs trailed 1-0 in the fourth before Baez’s three-run shot to left, his third homer of the road trip and sixth of the season. The Cubs have hit 17 home runs in their last six games.

Baez’s homer was all Hendricks needed to end his three-game losing streak.

Anthony Rizzo added a two-run single in the sixth, and Willson Contreras drove in a run with his third hit of the night in the three-run eighth.

The Cubs go for the sweep Thursday afternoon with Alec Mills taking the mound.

Before the game, the Cubs rotation took another hit when the team placed Jose Quintana on the 10-day injured list with left lat inflammation.

Quintana last pitched Sunday in Cincinnati, his second relief outing after missing the first month with a thumb injury incurred when he sliced his hand washing a wine glass. The veteran left-hander was expected to get a start this weekend against the Cardinals, replacing Tyler Chatwood, who went on the IL on Tuesday with an elbow strain.

Quintana’s IL stint is retroactive to Monday. There was no word on how serious the injury is or the Cubs’ immediate plans. Manager David Ross didn’t mention the injury during a teleconference Wednesday afternoon, and the announcement came afterward.

Adbert Alzolay, currently pitching at the Cubs alternative site in South Bend, Ind., is the likely option to replace Quintana against the Cardinals.

The Cubs did not seek starting pitching help at the trade deadline, instead adding lefty relievers Josh Osich and Andrew Chafin, who is also on the IL.

National League Pitcher of the Month Yu Darvish will start Friday’s opener of the Cardinals series.

The Cubs finally welcomed back third baseman Kris Bryant from the IL on Tuesday, but Bryant was back on the bench Wednesday after going 2-for-6 in Tuesday night’s 11-inning win over the Pirates.

Bryant said he felt fine, but Ross wanted to rest him because of the brief rehab stint in South Bend for a sprained finger.

“We’ve got a lot of games coming up,” Ross said. “He had at-bats (in South Bend) but not real innings. … I try to read body language, I try to take care of his body, with all the games we’ve got coming up.”