Anomalous $b\ensuremath{\rightarrow}s$ transitions from LHCb data may suggest a new massive gauge boson ${Z}^{\ensuremath{'}}$ that couples to the left-handed $b\ensuremath{\rightarrow}s$ current, which in turn implies a coupling to the $t\ensuremath{\rightarrow}c$ current. In this paper, we study flavor-changing neutral current (FCNC) decays of the top quark induced by a ${Z}^{\ensuremath{'}}$ boson, namely $t\ensuremath{\rightarrow}c{Z}^{\ensuremath{'}}$, based on a model of the gauged ${L}_{\ensuremath{\mu}}\ensuremath{-}{L}_{\ensuremath{\tau}}$ symmetry (the difference between the muon and tauon numbers) with vectorlike quarks, which was introduced to explain the anomalous LHCb data. We illustrate that searching for $t\ensuremath{\rightarrow}c{Z}^{\ensuremath{'}}$ via ${Z}^{\ensuremath{'}}\ensuremath{\rightarrow}{\ensuremath{\mu}}^{+}{\ensuremath{\mu}}^{\ensuremath{-}}$ with LHC Run 1 data can probe a parameter region that is unexplored by $B$ physics for a ${Z}^{\ensuremath{'}}$ mass of around $\mathcal{O}(10)\text{ }\text{ }\mathrm{GeV}$ or greater. We further extend the model to a very light ${Z}^{\ensuremath{'}}$ with mass below 400 MeV, which is motivated by the muon $g\ensuremath{-}2$ anomaly. Taking rare $B$ and $K$ meson decay data into account, we give upper limits on the $t\ensuremath{\rightarrow}c{Z}^{\ensuremath{'}}$ branching ratio for the light ${Z}^{\ensuremath{'}}$ case, and discuss about its observability at the LHC. We also scrutinize the possibility that the decay ${K}_{L}\ensuremath{\rightarrow}{\ensuremath{\pi}}^{0}{Z}^{\ensuremath{'}}$ with ${Z}^{\ensuremath{'}}\ensuremath{\rightarrow}\ensuremath{\nu}\overline{\ensuremath{\nu}}$ may lead to an apparent violation of the usual Grossman-Nir bound of $\mathcal{B}({K}_{L}\ensuremath{\rightarrow}{\ensuremath{\pi}}^{0}\ensuremath{\nu}\overline{\ensuremath{\nu}})<1.4\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}9}$.