The accretion of matter by compact objects can be inhibited by radiation pressure if the luminosity exceeds a critical value known as the Eddington limit. The discovery of ultraluminous X-ray sources has shown that accretion can proceed even when the apparent luminosity considerably exceeds this limit. A high apparent luminosity might be produced due to the geometric beaming of radiation by an outflow. The outflow half-opening angle, which determines the amplification due to beaming, has never been robustly constrained. Using the Imaging X-ray Polarimetry Explorer, we measured the X-ray polarization in the Galactic X-ray binary Cygnus X-3 (Cyg X-3). We found high, >20%, nearly energy-independent linear polarization orthogonal to the direction of the radio ejections. These properties unambiguously indicate the presence of a collimating outflow from the X-ray binary Cyg X-3 and constrain its half-opening angle to ≲15°. Thus, the source can be used as a laboratory for studying the supercritical accretion regime. This finding underscores the importance of X-ray polarimetry in advancing our understanding of accreting sources.