PITTSBURGH — Kris Bryant hit his 17th homer and the Chicago Cubs erupted following manager Joe Maddon’s fourth-inning ejection, routing the Pittsburgh Pirates 11-3 on Thursday to stop a four-game losing streak.

Bryant tied a season high with four hits, including a first-inning shot to the seats in right-center off Jordan Lyles (5-5). Robel Garcia finished a double short of the cycle in his first major league start. Willson Contreras drove in three runs for the Cubs, who moved back into a tie with Milwaukee for first place in the crowded NL Central, where all five teams are separated by 3 1/2 games.

Maddon watched the final 5 1/2 innings from the Chicago clubhouse after getting tossed following an exchange with the Pittsburgh dugout that ended with Maddon being restrained by home plate umpire Joe West.

Maddon appeared to take exception with Lyles pitching up and in to All-Star Javier Baez. He walked onto the field pointing his finger at Pirates manager Clint Hurdle. West and Bryant teamed up to hold Maddon back while Hurdle watched from just outside the Pittsburgh dugout.

Jose Quintana (6-7) allowed three runs and six hits in seven innings to win consecutive starts for the first time since April.

Kevin Newman had two hits and All-Star Josh Bell boosted his RBI total to a major league-leading 81 with a sacrifice fly, but the Pirates couldn’t pull off a four-game home sweep of the Cubs. Lyles surrendered a season-high seven runs and 10 hits, eight of them for extra bases, as Pittsburgh missed out on a chance to get back to .500 for the first time since May 31.

The Cubs have been in a weeks-long funk and fell to 8-15 in their last 23 games after a 6-5 loss Wednesday night in which the Pirates rallied for two runs in the ninth against recently signed closer Craig Kimbrel. Maddon called it perhaps the toughest loss his team has endured all season but said his club’s issues could be easily solved with just a little offense.

Chicago responded by putting up its highest run total since a 14-6 win over Washington on May 17.

Albert Almora Jr. hit his eighth homer in the second and Contreras added a two-run shot in the third off Lyles.

Still, the Cubs led just 4-3 when Maddon took exception with a pair of high-and-tight pitches to Baez with two outs in the fourth. The shortstop appeared to tweak his left knee on the first but remained in the game. Lyles then went back inside on Baez again, leading Maddon to stomp out of the dugout in frustration.

Lyles eventually struck Baez out, but it would be his final stand. Bryant doubled leading off the fifth, Rizzo followed with an RBI single and Contreras added a single of his own to chase Lyles. Clay Holmes hit David Bote in the head to force in a run and Baez finished off Chicago’s five-run outburst by lacing a two-run single to make it 9-3.