Time-differential perturbed angular correlation (TDPAC) measurements have been carried out in stoichiometric ZrNi$_3$ and HfNi$_3$ intermetallic compounds using $^{181}$Ta probe in the temperature range 77-1073 K considering the immense technological applications of Zr-Ni and Hf-Ni intermetallic compounds. In ZrNi$_3$, four components due to the production of Zr$_2$Ni$_7$, Zr$_8$Ni$_{21}$, Zr$_7$Ni$_{10}$ and ZrNi$_3$ have been found at room temperature. The HfNi$_3$ sample produces five electric quadrupole interaction frequencies at room temperature. The phase HfNi$_3$ is strongly produced in stoichiometric sample of HfNi$_3$ where two non-equivalent Hf sites are found to be present. Besides this phase, two other phases due to Hf$_2$Ni$_7$ and Hf$_8$Ni$_{21}$ have been found but, we do not observe any phase due to Hf$_7$Ni$_{10}$. X-ray diffraction, TEM/energy dispersive X-ray spectroscopy (EDX) and TEM-selected area electron diffraction (SAED) measurements were used to further characterize the investigated materials and it was found that these results agree with the TDPAC results. In order to confirm findings from TDPAC measurements, density functional theory (DFT) based calculations of electric field gradients (EFG) and asymmetry parameters at the sites of $^{181}$Ta probe nucleus were performed. Our calculated results are found to be in excellent agreement with the experimental results.