  Using a combination of infrared ellipsometry, time-domain terahertz
spectroscopy, and far-infrared reflectometry we have obtained the $ac$-plane
complex dielectric function of monoclinic ($C2/c$) Ta$_2$NiSe$_5$ and
orthorhombic ($Cmcm$) Ta$_2$NiS$_5$ single crystals. The identified
dipole-active phonon modes polarized along $a$ and $c$ axes are in good
agreement with density functional theory calculations. With increasing
temperature the $a$-axis phonon modes of Ta$_2$NiSe$_5$ become poorly
discernible, as they are superimposed on the electronic background which
gradually fills the energy gap near the monoclinic-to-orthorhombic phase
transition temperature $T_c$ = 326 K. In Ta$_2$NiS$_5$, which does not exhibit
such a structural transition and remains orthorhombic down to low temperatures,
the $a$-axis phonon modes are superimposed on a persistent broad electronic
mode centered near 16 meV. We attribute this difference to strongly overlapping
exciton-phonon complexes in Ta$_2$NiSe$_5$, as opposed to isolated instances of
the same in Ta$_2$NiS$_5$, and find this to be in good agreement with an
excitonic insulator state below $T_c$ in the former, as compared to the absence
of one in the latter.

Strongly Correlated Electrons