The formation of gaseous giant planets is thought to occur in the first few million years after stellar birth. Models predict that the process produces a deep gap in the dust component (shallower in the gas). Infrared observations of the disk around the young star HD 142527 (at a distance of about 140 parsecs from Earth) found an inner disk about 10 astronomical units (AU) in radius (1 AU is the Earth-Sun distance), surrounded by a particularly large gap and a disrupted outer disk beyond 140 AU. This disruption is indicative of a perturbing planetary-mass body at about 90 AU. Radio observations indicate that the bulk mass is molecular and lies in the outer disk, whose continuum emission has a horseshoe morphology. The high stellar accretion rate would deplete the inner disk in less than one year, and to sustain the observed accretion matter must therefore flow from the outer disk and cross the gap. In dynamical models, the putative protoplanets channel outer-disk material into gap-crossing bridges that feed stellar accretion through the inner disk. Here we report observations of diffuse CO gas inside the gap, with denser HCO+ gas along gap-crossing filaments. The estimated flow rate of the gas is in the range of 7 × 10-9 to 2 × 10-7 solar masses per year, which is sufficient to maintain accretion onto the star at the present rate.