The conditions were beginning to turn miserable Thursday night when Hector Neris finally left the Phillies bullpen, jogged through the outfield, and headed for the mound.

The Phillies were clinging to a one-run lead with two outs in the eighth inning and the Braves had runners on second and third. If that was not enough of a challenge, a misty rain began to sweep through windy Citizens Bank Park.

The forecast for both the weather and a win was not ideal. And this — a 9-5 win over the Braves — was a game the Phillies needed to keep their playoff hopes alive. But the team’s chances were beginning to feel as slim as the 3.4-percent odds FanGraphs gives them to reach the playoffs.

The Cubs, Brewers, and Mets all won before the Phillies threw their first pitch. The calendar is nearing October and the Phillies cannot afford to lose any more ground.

They they asked Neris for a four-out save. He had not had a save longer than three outs since June 25. But this was a game the Phillies needed.

First, they needed him to get just one. He battled Dansby Swanson for seven pitches; five of them Swanson fouled off. Finally, Neris threw a fastball and Swanson lined out sharply to left field. The rally was extinguished, the Phillies were three outs away from a needed win, and their playoff dreams remained.

“Taking it one win at a time as a group,” manager Gabe Kapler said. “That’s beneficial for us, coming together, deciding that we are going to fight to the very last second and that means grinding out every single pitch. That means picking each other up."

The Phillies are off Friday before opening a two-game series Saturday against the Red Sox. They are two games behind Milwaukee and Chicago for the second-wild card, tied with the Mets, and 1½ games ahead of Arizona.

They then travel to Atlanta, Cleveland, and Washington before finishing the season with the always-troubling Marlins.

The road to October will be difficult, but there’s a chance. And if the Phillies reach the playoffs, it will be nights like Thursday that get them there.

“There’s a big scoreboard out there that tells us the whole thing,” J.T. Realmuto said of the ability to keep track of the wild-card race. “Obviously, we’re watching the other teams that we’re behind and teams we’re trying to keep up with. We knew they had all won today, so it was a big game for us. We needed to go out and get a W and we got it done.”

Adam Haseley hit a two-run homer and made a terrific sliding catch, Cesar Hernandez blasted a leadoff homer, and Maikel Franco slid past an ill-applied tag by Brian McCann in the sixth after Hernandez singled to right.

After Neris escaped the eighth, Sean Rodriguez provided some breathing room with an RBI double to left field. If that was not enough, J.T. Realmuto powered a two-run homer through the rain.

Neris jogged to the mound with a one-run lead in the eighth and returned to it in the ninth with a four-run cushion.

The Phillies have 16 games remaining. They will lean on their offense to hit them into the playoffs and cross their fingers that the other teams in the race stumble just enough. But they will also lean heavily on their bullpen and pitchers who were far from their plans when the season began.

“We feel like we’re start to get to where we needed to be all year long,” Realmuto said. “We feel like we could’ve done a lot better offensively the first half of the season, whatever. But we feel like we’re getting clicking at the right time.

"These are the times, especially the teams that are coming up have really great pitching, but they also have really great offenses, so we’re going to need to score runs. That’s what we’ve got to do to win.”

Kapler used five relievers Thursday night after he lifted Drew Smyly after just four innings. The Braves tagged him for a pair of homers and a three-run Phillies lead was down to just one.

Kapler knew the best route to a win was through his bullpen. It is safe to expect nights like this as the manager aggressively uses his pitching staff and tries to squeeze every win out of his team.

“It goes without saying what a tremendous job our bullpen did this entire series,” Kapler said. “The guys who weren’t expected to contribute, right, a couple games back, middle of September, and type of guys like Blake Parker and Jared Hughes step up in huge situations for us. Those are really tough lineups, tough hitters, getting big outs for us in a pennant race.”

Hughes, Ranger Suarez, Parker, Jose Alvarez, and Neris combined to allow just one run. They answered Kapler’s call and provided the heavy lifting. Parker allowed the lone run on a home run in the seventh inning to Ronald Acuna.

The homer sailed toward the Phillies bullpen, catching Neris by surprise as he leaped dramatically off his chair out of the way. The Phillies still had a one-run lead and their closer was safe. They would soon need him in a game they needed to win.