Tuning many-body electronic phases by an external handle is of both fundamental and practical importance in condensed matter science. The tunability mirrors the underlying interactions, and gigantic electric, optical and magnetic responses to minute external stimuli can be anticipated in the critical region of phase change. The excitonic insulator is one of the exotic phases of interacting electrons, produced by the Coulomb attraction between a small and equal number of electrons and holes, leading to the spontaneous formation of exciton pairs in narrow-gap semiconductors/semimetals. The layered chalcogenide Ta$_2$NiSe$_5$ has been recently discussed as such an excitonic insulator with an excitation gap of ~250 meV below $T_c$ = 328 K. Here, we demonstrate a drastic collapse of the excitation gap in Ta$_2$NiSe$_5$ and the realization of a zero-gap state by moving the tip of a cryogenic scanning tunneling microscope towards the sample surface by a few angstroms. The collapse strongly suggests the many-body nature of the gap in the insulating state of Ta$_2$NiSe$_5$, consistent with the formation of an excitonic state. We argue that the collapse of the gap is driven predominantly by the electrostatic charge accumulation at the surface induced by the proximity of the tip and the resultant carrier doping of the excitonic insulator. Our results establish a novel phase-change function based on excitonic insulators.