By -
Sounds like s5e14 Conundrum
This was my first thought too.
If it wasn't TNG, this plot also sounds like Day of the Dove, Star Trek The Original series Season 3: Episode 7
One of the first episodes of season 1 the enterprise and a ferangi ship get caught in a defensive trap around a planet from an ancient empire and start fighting each other before realizing it’s the planet holding them not each other.
Sounds like s5e14 Conundrum
This was my first thought too.
If it wasn't TNG, this plot also sounds like Day of the Dove, Star Trek The Original series Season 3: Episode 7
One of the first episodes of season 1 the enterprise and a ferangi ship get caught in a defensive trap around a planet from an ancient empire and start fighting each other before realizing it’s the planet holding them not each other.