The masses of stars, including stellar remnants, are almost exclusively known from binary systems. In this paper, we study the gravitational microlensing of faint background galaxies caused by isolated neutron stars (pulsars). We show that the resulting distortions in the surface brightness can be used to determine the masses of neutron stars. Because of their different evolutionary histories, isolated neutron stars might have different masses from those in binary systems, which can thus provide a unique insight into their equation of states under extreme physical conditions. Having searched the existing pulsar catalogues, we have found one promising pair, consisting of a nearby pulsar and a background galaxy. This method will become more practical for the next-generation optical and radio surveys and telescopes.