We present a novel method for revealing the equation of state of high-density neutron star matter through gravitational waves emitted during the postmerger phase of a binary neutron star system. The method relies on a small number of detections of the peak frequency in the postmerger phase for binaries of different (relatively low) masses, in the most likely range of expected detections. From such observations, one can construct the derivative of the peak frequency versus the binary mass, in this mass range. Through a detailed study of binary neutron star mergers for a large sample of equations of state, we show that one can extrapolate the above information to the highest possible mass (the threshold mass for black hole formation in a binary neutron star merger). In turn, this allows for an empirical determination of the maximum mass of cold, nonrotating neutron stars to within 0.1 M_sun, while the corresponding radius is determined to within a few percent. Combining this with the determination of the radius of cold, nonrotating neutron stars of 1.6 M_sun (to within a few percent, as was demonstrated in Bauswein et al., PRD, 86, 063001, 2012), allows for a clear distinction of a particular candidate equation of state among a large set of other candidates. Our method is particularly appealing because it reveals simultaneously the moderate and very high-density parts of the equation of state, enabling the distinction of mass-radius relations even if they are similar at typical neutron star masses. Furthermore, our method also allows to deduce the maximum central energy density and maximum central rest-mass density of cold, nonrotating neutron stars with an accuracy of a few per cent.