The Phillies were 12 outs Thursday from boarding a flight to Miami and starting the season’s final month with an underwhelming afternoon in Washington. They trailed the Nationals, 6-0, after five innings. A loss felt inevitable.

But if the Phillies are to return to October for the first time in a decade, they’ll have to win games that feel like losses. And that’s what they did Thursday, overcoming a disappointing start from Aaron Nola, jumping on Washington’s inept bullpen, and rallying to board their flight with a 7-6 victory, their sixth straight win.

Andrew McCutchen drove in four runs, Odubel Herrera had three hits, and J.T. Realmuto returned to the lineup. The Phillies entered Thursday trailing the Atlanta Braves by two games for first place in the National League East and 2½ games behind the Cincinnati Reds for the NL’s second wild card. They started September with one of their biggest wins of the season and flew to Miami with momentum.

“In a world that we want to be in, we’ll be in first place,” McCutchen said when asked how he thinks the season will end. “We’ll be raising that banner for winning the division. We know what we can do and we have the schedule to be able to do it. We just have to go out there and do it. It’s an exciting month and it’s what baseball is all about.”

Clutch Cutch

It would have been easy for the Phillies to fold on Thursday after falling behind by six runs, but McCutchen said the team never wilted.

“We were like ‘Keep it there, guys. Keep it there. We know we’re going to score at least seven. It’s going to happen.’ It got some chuckles, some laughs, but we knew we had a chance,” McCutchen said as the Phillies had scored at least seven runs in their previous six games.

McCutchen lined a three-run double in the sixth inning to cut that six-run deficit in half and give the Phillies some life. He drove in another in the eighth and supplied the Phillies’ first four RBIs.

» READ MORE: Former Phillie Steve Bedrosian’s advice to son upon joining old team: ‘Stay even-keeled’

The Phillies were down only two runs, had a runner on first, and it no longer felt like a loss. Five batters later, they had their seventh run.

“We always have a chance to come back and that’s important for a team to have that feeling,” manager Joe Girardi said. “Yes, you can get down, but hey, get a couple guys on and let’s see what happens. Cutch comes up with a big double and scores three and all of a sudden we’re back in the game. Cutch has been through this. He’s been through this a lot. Playoff runs. He understands what he needs to do.

McCutchen had five hits in the series and drove in eight runs. He was one of the Phillies’ most productive hitters before a knee injury put him on the injured list for the first 10 days of August. He has since struggled offensively, but this series in D.C. may be the spark he needs. The Phillies could use his bat in September.

“It feels good to play like I know I can play,” McCutchen said. “It only took until September, but the past couple games, I’ve been feeling good. ... I have to say in the Rays series at home, I was starting to feel like myself again. I was like ‘OK. Have to finish strong.’ It’s not about how you start but how you finish.”

Nola’s day

The offense took Nola off the hook, but that’s not enough to quiet the concerns about the return of his September struggles. Nola allowed six runs in four-plus innings after he was removed with the bases loaded and no outs in the fifth.

The Phillies lost Nola’s final three starts last September and he now has a 5.37 ERA over the last three seasons when he pitches in the month. The Phils overcame it Thursday, but they’ll need him to right himself to make their path to October more manageable.

Nats’ fielding

The Phillies received some help in the eighth inning by Washington second baseman Luis Garcia.

Nick Maton tied the score after reaching on an error that could have been a double play but skipped past Garcia. One batter later, Odubel Herrera put the Phils ahead when the Nats were unable to turn an inning-ending double play. Garcia fielded the grounder and looked to throw home before throwing to second. That delay allowed Herrera to beat the throw to first, which kept the go-ahead run on the board.

Realmuto returns

Realmuto’s sore ankle didn’t seem to give him any trouble as he sprinted all the way from first base on McCutchen’s three-run double. Realmuto returned to the lineup for the first time after he rolled his ankle on Sunday and missed the first two games of the series. He played first base, a position he could be used at often this month.