NEW YORK — The Phillies had lost three-straight games when they arrived Saturday afternoon at Citi Field. They were stuck in the back of a wild-card slog, Bryce Harper had a sore hand, and their playoff dreams were fading away.

In a few hours, they would face Marcus Stroman, the righthander the Mets ponied up to acquire at the trade deadline. Sunday would bring Noah Syndergaard. It was the first of six straight series against teams with winning records. The regular season ends in three weeks, and picturing the Phillies playing in October can often seem like a fantasy.

But it is that belief, manager Gabe Kapler said, that the players are using to fuel them for the season’s final stretch. The Phillies kept their playoff hopes alive Saturday night with a 5-0 win over the Mets. Drew Smyly pitched seven scoreless innings and the Phillies gained ground on both the Cubs and Nationals in the wild-card picture.

“We all kind of came in with a chip on our shoulders,” Kapler said. “I think we know that we’ve been written off and we don’t care. We’re going to keep fighting and clawing for every last inch.”

Relief pitcher Nick Pivetta (43) and first baseman Rhys Hoskins (17) celebrate after defeating the New York Mets.
Mary Altaffer / AP
Relief pitcher Nick Pivetta (43) and first baseman Rhys Hoskins (17) celebrate after defeating the New York Mets.

The Phillies are three games behind the Cubs for the National League’s second wild card. They are a game better than the Mets, even with the Brewers, and 1½ games behind Arizona. The Nationals hold the first wild card, but are just two games better than the Cubs. It’s a crowded picture.

For the Phillies to emerge, they’ll need almost every night to be like Saturday.

“I think we’ve been forgotten about for a while now, for whatever reason,” Rhys Hoskins said. “The teams in our division have played extremely well in the second half and we’ve been kind of up and down. That’s what happens when you do that.”

Smyly struck out six and allowed four hits. He retired 12 of the final 13 batters he faced. Adam Haseley made a terrific catch in right field to end the first inning and strand the bases loaded. It could have been a different game had Todd Frazier’s line drive eluded Haseley. Instead, it was the start of a needed win.

The Phillies can win the series Sunday and return home with a winning road trip.

“None of us have lost confidence,” Smyly said. “There’s still a lot of games left. Regardless of the standings or the schedule, if we win then we put ourselves in a really good situation. The time is now and we have to go do it.”

Nights like Saturday -- when three pitchers combined for nine scoreless innings -- are a bonus. The Phillies do not expect to ride their starting pitchers deep into games. They do not expect to shut out opponents. They may disagree that their playoff hopes are bleak, but they will not disagree that their best route to October is to lean on their offense.

“For us to win games, we have to have big innings," Kapler said before the game. "We just have to score runs in bunches.”

Cesar Hernandez watches the ball after hitting an RBI single in the fourth inning.
Mary Altaffer / AP
Cesar Hernandez watches the ball after hitting an RBI single in the fourth inning.

Cesar Hernandez jump-started the Phillies with a leadoff homer in the first inning. Three of the next four batters reached base on an infield single, a muffed pop-up, and a bloop single. The bases were loaded, and Kapler’s big inning felt near. Instead, Brad Miller struck out and Scott Kingery lined sharply to the pitcher. The Phillies missed their chance.

But they made up with it in the fourth. Hernandez and J.T. Realmuto singled in runs before Corey Dickerson’s double brought in two more. It was a big inning.

They did it without Bryce Harper, who watched from the dugout as his right hand remained sore from being hit by a pitch Friday night. They might have to go without Harper again Sunday as the outfielder’s status remains uncertain.

“We know that we’re being counted out,” Kapler said. “We understand that that’s the sentiment. And we don’t believe it.”

Smyly’s night allowed the Phillies to give their bullpen a needed rest. Kapler went into the game knowing that six of his relievers were unavailable. Cole Irvin pitched the eighth and Nick Pivetta handled the ninth. The Phillies will enter Sunday with a freshened relief corps.

But then the next challenge begins. The Phillies open a six-game home stand against the Braves and Red Sox before traveling to Atlanta, Cleveland, and Washington.

While their trying to beat playoff contenders, they’ll root for teams like the Pirates and Padres to beat the Cubs and the Marlins and Reds to beat the Diamondbacks. The Phillies may believe in themselves, but that might not be enough to launch them into October.

“At this point of the season, if you can’t get up to try and get into the playoffs then you probably need to be doing something else,” Hoskins said.