CHICAGO - Andrew McCutchen opened his glove, looked at the ball nestled inside, turned to the sky, and exhaled.

It was finally safe to breathe. A 9-7 win over the Cubs on Thursday was over. The Phillies had survived. They sped to a seven-run lead and then had the harrowing experience of watching their bullpen nearly burn it away. It wasn’t easy, but it was a win.

It was enough to salvage a four-game split at Wrigley Field. Afterward the Phillies bused 90 miles north to Milwaukee to begin an equally challenging series against the Brewers. The afternoon win pushed them into the weekend with drive.

“You always want it to be a piece of cake,” manager Gabe Kapler said. “But that would be a pie-in-the-sky fantasy. It doesn't work like that.”

The ballpark -- just as it seemed to all week in a series that featured two teams with postseason ambitions -- came alive in the ninth inning as the Cubs brought the winning run to the plate with just one out.

Hector Neris started the inning with seven straight balls and had just allowed an RBI double to a pitcher moonlighting as a pinch-hitter.

Neris, with the crowd roaring, had to figure out how he could retire two more batters.

No sweat. Neris struck out Addison Russell on three pitches. Then he extinguished the fire by forcing Victor Caratini into a lazy fly ball to McCutchen for the final out.

“Sometimes that happens,” Neris said, patting his heart.

Neris was the fifth reliever Kapler used as the manager operated his bullpen aggressively after Aaron Nola exited with one out in the sixth.

Adam Morgan, Seranthony Dominguez, Pat Neshek, and Jose Alvarez combined for a five-out stretch. Kapler, two days after a shorthanded bullpen cost him a win, did not alter the way he managed his relievers.

Nola thought Kapler was approaching the mound for a visit and not a pitching change in the sixth inning. He had thrown 93 pitches and had just retired Willson Contreras for the inning’s first out. But that was it. Adam Morgan was called on to face Jason Heyward.

Nola allowed three runs on four hits with six strikeouts and four walks.

The Phillies, Kapler said earlier this week, remain “consistent with the approach of aggressively going after wins.” Pulling your best pitcher after just 5⅓ innings and a five-run lead is evidence.

Nola said he felt he could have stayed in to face Heyward and worked a double play. He was surprised to be lifted.

“Sure, Noles being who he is could have gotten through that inning,” Kapler said. “But we don’t have the ability to have the alternate universe and see what could have happened if we left Nola out there. These are the debates, the natural debates that happen after a game like this.”

Neshek allowed three runs on two homers in the seventh. Dominguez escaped a bases-loaded jam in the sixth when Sean Rodriguez fielded a chopping grounder and dove toward third base to tag Heyward before he could step on the bag.

Rodriguez, Kapler said, started Thursday because of his defense. It was that defense that stymied a rally.

“I know it’s an old saying, probably used more in basketball than it is in baseball, but ‘Offense gets the glory but defense wins the game,’” Rodriguez said. “A lot of times defense doesn’t necessarily get a lot of attention.”

J.T. Realmuto hit the farthest homer of his career in the third inning with a 456-foot shot that cleared the left-field bleachers and bounced onto Waveland Avenue. Jean Segura extended his hitting streak to 14 games with a double and then added a two-run homer in the fourth.

The first five batters in the Phillies lineup had RBIs. They chased Jon Lester after just four innings and were leading, 7-0.

After three tough nights on Chicago’s North Side, it seemed as if the series was about to end with an easy afternoon. A rout at Wrigley Field would make the bus ride through rush-hour traffic much more enjoyable. But the afternoon was far from finished. It wasn’t time to exhale just yet.

“You have to keep grinding it out because that’s what those guys over there on the other side are built to do,” Rodriguez said. “Every team’s obviously built to try to come back in any kind of game. When they start coming back, that just obviously shows what kind of resiliency we have as a team.”

Get insights on the Phillies delivered straight to your inbox with Extra Innings, our newsletter for Phillies fans by Matt Breen, Bob Brookover and Scott Lauber. Click here to sign up.