Closed string amplitudes at genus h ≤ 3 are given by integrals of Siegel modular functions on a fundamental domain of the Siegel upper half-plane. When the integrand is of rapid decay near the cusps, the integral can be computed by the Rankin-Selberg method, which consists of inserting an Eisenstein series E h (s) in the integrand, computing the integral by the orbit method, and finally extracting the residue at a suitable value of s. String amplitudes, however, typically involve integrands with polynomial or even exponential growth at the cusps, and a renormalization scheme is required to treat infrared divergences. Generalizing Zagier's extension of the Rankin-Selberg method at genus one, we develop the Rankin-Selberg method for Siegel modular functions of degree 2 and 3 with polynomial growth near the cusps. In particular, we show that the renormalized modular integral of the Siegel-Narain partition function of an even self-dual lattice of signature (d, d) is proportional to a residue of the Langlands-Eisenstein series attached to the h-th antisymmetric tensor representation of the T-duality group O(d, d, Z).