Two of the most widely studied extensions of the Standard Model (SM) are $a)$ the addition of a new $U(1)$ symmetry to its existing gauge groups, and $b)$ the expansion of its scalar sector to incorporate a second Higgs doublet. We show that when combined, they allow us to understand the electron-like event excess seen in the MiniBooNE (MB) experiment as well as account for the observed anomalous values of the muon magnetic moment. A light $Z$ associated with an additional $U(1)$ coupled to baryons and to the dark sector, with flavor non-universal couplings to leptons, in conjunction with a second Higgs doublet is capable of explaining the MB excess. The $Z$ obtains its mass from a dark singlet scalar, which mixes with the two Higgs doublets. Choosing benchmark parameter values, we show that $U(1)_{B-3L_tau}$, which is anomaly-free, and $U(1)_B$, both provide (phenomenologically) equally good solutions to the excess. We also point out the other (anomaly-free) $U(1)$ choices that may be possible upon fuller exploration of the parameter space. We obtain very good matches to the energy and angular distributions for neutrinos and anti-neutrinos in MB. The extended Higgs sector has two light CP-even scalars, $h$ and $H$, and their masses and couplings are such that in principle, both contribute to help explain the MB excess as well as the present observed values of the muon and electron $g-2$. We discuss the constraints on our model as well as future tests. Our work underlines the role that light scalars may play in understanding present-day low-energy anomalies. It also points to the possible existence of portals to the dark sector, i.e., a light gauge boson field $(Z)$ and a dark neutrino which mixes with the active neutrinos, as well as a dark sector light scalar which mixes with the extended Higgs sector.