In this work, we use a test based on the differential ages of galaxies for distinguishing the dark energy models. As proposed by Jimenez and Loeb, relative ages of galaxies can be used to put constraints on various cosmological parameters. In the same vein, we reconstruct $H_0dt/dz$ and its derivative ($H_0d^2t/dz^2$) using a model independent technique called non-parametric smoothing. Basically, $dt/dz$ is the change in the age of the object as a function of redshift which is directly link with the Hubble parameter. Hence for reconstruction of this quantity, we use the most recent $H(z)$ data. Further, we calculate $H_0dt/dz$ and its derivative for several models like Phantom, Einstein de Sitter (EdS), $Lambda$CDM, Chevallier-Polarski-Linder (CPL) parametrization, Jassal-Bagla-Padmanabhan (JBP) parametrization and Feng-Shen-Li-Li (FSLL) parametrization. We check the consistency of these models with the results of reconstruction obtained in model independent way from the data. It is observed that $H_0dt/dz$ as a tool is not able to distinguish between the $Lambda$CDM, CPL, JBP and FSLL parametrizations but as expected EdS and Phantom models show noticeable deviation from the reconstructed results. Further, the derivative of $H_0dt/dz$ for various dark energy models is more sensitive at low redshift. It is observed that the FSLL model is not consistent with the reconstructed results at redshifts less than $0.5$, however, the $Lambda$CDM model is in concordance with the 3$sigma$ region of the reconstruction.