We proposed that BaHgSn is a Dirac semimetal (DSM) which can host hourglass-like surface states (HSSs) as protected by nonsymmorphic glide symmetry. Compared to KHgSb, an isostructural topological crystalline insulator with the same HSSs, BaHgSn has an additional band inversion at $\Gamma$ point. This band inversion is induced by the stronger interlayer coupling among Hg-Sn honeycomb layers than that among Hg-Sb-layers in KHgSb, which leads to bulk Dirac nodes in BaHgSn along the layer stacking direction $\Gamma$-$A$. In addition, the mirror Chern number $C_{i}$ protected by the mirror plane $\overline{M}_{z}$ ($k_z$=0) changes from 2 in KHgSb to 3 in BaHgSn. Therefore, when a compressive uniaxial strain is applied along the $y$ axis to break the rotation symmetry protecting the DSM state, BaHgSn becomes a strong topological insulator with $Z_{2}$ indices of $(1;000)$ and the topological surface Dirac cone co-exists with HSSs on the (010) surface. The Wilson-loop spectra have been calculated to verify these topological features. The calculated surface states, the Fermi surfaces and their quasiparticle interference patterns are ready to be compared with experimental measurements.