What episode opens with a Borg ship closing in on the Enterprise, then flies past because it's being chased?
It was a two-part show.
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.Sign up to join this community
My selection for a scene with the Borg that most closely matches your description is:
In the second act, Voyager is approaching Borg space determined to avoid the Borg territory back to the Alpha Quadrant by riding what they dubbed the Northwest Corridor. Filled with gravimetric disturbances, it would hide them from the Borg and is surprisingly Borg-free.
As the approach the corridor, they are surprisingly confronted by fifteen Borg vessels that are on a collision course. But instead of engaging Voyager, they fly right past it instead.
This episode debuts the menace of Species 8472, an alien species from a subspace dimension dubbed "fluidic space".
There are four other Borg episode pairs but only one of them is a Star Trek Next Generation episode that includes Borg cube starships. By process of elimination you can only be discussing:
Best of Both Worlds Part 1
In the second act, the Borg vessel approaches the Enterprise and demands the individual surrender of Captain Jean Luc Picard. The Borg attack the Enterprise and surprise, the Enterprise's weapons are ineffective. After adapting phasers to escape the Borg tractor beam, the Enterprise flees the scene with the Borg giving chase.
In the third act, the Enterprise hides in a nearby nebula, makes repairs and attempts to design new weapons. The Borg drop space mines to drive the Enterprise out of the nebula. We don't see the Borg cube move again until Enterprise leaves the nebula, flying past the Borg cube. The cube pursues.
This is the only scene in this episode that even partially matches the Enterprise passing a Borg Cube.
Best of Both Worlds Part 2
In this continued confrontation with the Borg, Captain Jean Luc Picard is kidnapped and converted into Locutus of Borg, to act as an intermediary for the peaceful surrender of the Federation to the Borg.
This episode opens with the Enterprise directly confronting the Borg cube, preparing to use the deflector array as a weapon system.
The Enterprise fails to even cause a scratch due to the Borg's integration of Picard's knowledge. The Borg cube leaves the Enterprise heading toward Sector 001. The Enterprise is unable to give chase since its warp core was damaged after using it to power the deflector weapon.
It will take the Enterprise eight hours to repair the warp engines. This causes them to miss the battle at Wolf 359 where the Federation defenses are wiped out. The Enterprise is never again able to catch up to the Borg cube during the remainder of the episode.
Given your description and after watching both episodes, there is no scene where the Borg cube approaches the Enterprise and then leaves as you describe.
It sounds like you're referring to the two-part Voyager episode "Scorpion" (1997).
Voyager is passed by an armada of Borg cubes.
If it's TNG, then it's the first scene of "Best of Both Worlds, part II" (1990). The Enterprise's weapon fails (because the Borg got Picard/Locutus), and then they warp off to sector 001 with the Enterprise unable to pursue.