We present the results of HI spectral stacking analysis of Giant Metrewave Radio Telescope (GMRT) observations targeting the COSMOS field. The GMRT data cube contains 474 field galaxies with redshifts known from the zCOSMOS-bright 10k catalogue. Spectra for the galaxies are co-added and the stacked spectrum allows us to make a $sim 3sigma$ measurement of the average HI mass. Using this average HI mass along with the integral optical $B$-band luminosity of the galaxies and the luminosity density of the COSMOS field, a volume normalisation is applied to obtain the cosmic HI mass density ($Omega_{rm HI}$). We find a cosmic HI mass density of $Omega_{rm HI}$ = (0.42 $pm$ 0.16) $times$ 10$^{-3}$ at $z sim 0.37$, which is the highest-redshift measurement of $Omega_{rm HI}$ ever made using HI spectral stacking. The value we obtained for $Omega_{rm HI}$ at $z sim 0.37$ is consistent with that measured from large blind 21-cm surveys at $z = 0$ as well as measurements from other HI stacking experiments at lower redshifts. Our measurement in conjunction with earlier measurements indicates that there has been no significant evolution of HI gas abundance over the last 4 Gyr. A weighted mean of $Omega_{rm HI}$ from all 21-cm measurements at redshifts $z lesssim 0.4$ gives $Omega_{rm HI}$ = (0.35 $pm$ 0.01) $times$ 10$^{-3}$. The $Omega_{rm HI}$ measured (from HI 21-cm emission measurements) at $z lesssim 0.4$ is however approximately half that measured from Damped Lyman-$alpha$ Absorption (DLA) systems at $z gtrsim 2$. Deeper surveys with existing and upcoming instruments will be critical to understand the evolution of $Omega_{rm HI}$ in the redshift range intermediate between $z sim 0.4$ and the range probed by DLA observations.