Owing to their atomic-scale thickness, the resonances of two-dimensional (2D) material membranes show signatures of nonlinearities at forces of only a few picoNewtons. Although the linear dynamics of membranes is well understood, the exact relation between the nonlinear response and the resonator's material properties has remained elusive. Here we show a method for determining the Young's modulus of suspended 2D material membranes from their nonlinear dynamic response. To demonstrate the method, we perform measurements on graphene and MoS2 nanodrums electrostatically driven into the nonlinear regime at multiple driving forces. We show that a set of frequency response curves can be fitted using only the cubic spring constant as a fit parameter, which we then relate to the Young's modulus of the material using membrane theory. The presented method is fast, contactless, and provides a platform for high-frequency characterization of the mechanical properties of 2D materials.