NEW YORK — Four years ago, Cubs manager Joe Maddon resorted to hiring a magician on the first day of a series in New York to distract and shake up a slumping team. What followed was a Cubs sweep of the Mets.

On Tuesday, a Cubs team at an even more dire crossroads stumbled into the same place and experienced a moment that seemed more mystical and paranormal than anything Simon the Magician could pull out of a hat.

What will the circumstances of the Cubs’ 5-2 victory mean in the larger picture?

‘‘We’re going to find out tomorrow,’’ manager Joe Maddon said, referring to Noah Syndergaard and Jacob deGrom starting for the Mets the next two games.

Till then, consider the supernatural forces that appeared on one night in one division race:

• As the Cubs fought to close the gap in the National League Central, the first-place Cardinals endured a rain delay. In Milwaukee. At a stadium with a roof. (The roof was unable to be closed in time to avoid the effects of a quick-passing torrent.)

• After right-hander Yu Darvish pitched the Cubs to victory with his longest start with the team, he offered an unsolicited nod to indelicate Chicago talking head David Kaplan, who engaged in a losing Twitter debate with Darvish in recent days over pitch selection.

‘‘Kaplan makes sense,’’ Darvish said — in what was thought to be the first time a real-life major-leaguer has said that — after describing some of his altered pitch sequencing.

‘‘But he’s still full of crap, right?’’ one Chicago scribe retorted, with no visible change in Darvish’s eerily sincere demeanor.

• The slumping Javy Baez, who doubled twice and homered, also drew a walk — only his seventh in his last 51 games. And Darvish allowed a walk — his first since July 23.

• And most of all, this: The victory came on the road, where the Cubs have threatened all season to leave their playoff chances in a tire-marked heap on the shoulder.

‘‘These are all big games the rest of the way,’’ said Cubs president Theo Epstein, who made a rare road appearance with the team for this series. ‘‘The standings have changed quite a bit the last 2½ weeks. We’re not on the side of it we want to be anymore. They all become big games.’’

The Cubs still trail by three games in the division after the Cardinals won, and they’re in a four-team scrum for the NL’s second wild-card spot with 31 games left.

But after Addison Russell and Baez hit two-run homers and after Darvish responded to a rough finish in his previous start with eight sharp innings, the Cubs suddenly had won three consecutive games on the road for only the third time this season — and the first time since a five-game streak April 27-May 14.

The Cubs were so beaten-down during their weekend sweep at the hands of the Nationals that when Russell’s two-run homer cleared the center-field wall in the fifth, they had their first lead since Thursday.

‘‘He looks really good right now,’’ Maddon said of Russell. ‘‘His overall game can really propel us, I believe.’’

Baez’s walk was his second in as many games, and Maddon said the homer and double that followed were no coincidence.

‘‘With everybody, when you have an organized strike zone, you will hit better,’’ he said. ‘‘You’re going to get more pitches to drive.’’

If Baez and Russell in the middle are important parts for the Cubs down the stretch, Darvish is critical. Darvish, who asked to start in the first game after the All-Star break for a weary and dinged-up rotation, has a 2.93 ERA with 72 strikeouts and only three walks in nine starts since then.

‘‘I was so sad about the walk — four-pitch walk,’’ said Darvish, who called it ‘‘embarrassing.’’

At that point, he was reminded it was his only walk this month.

‘‘But still,’’ he said.