We study the theta dependence of four-dimensional SU(N) gauge theories, for N greater than or equal to 3 and in the large-N limit. We use numerical simulations of the Wilson lattice formulation of gauge theories to compute the first few terms of the expansion of the ground-state energy F(theta) around theta = 0, F(theta) - F(0) = A(2)theta(2) (1 + b(2)theta(2) + ...). Our results support Witten's conjecture: F(theta) - F(0) = Atheta(2) + O(1/N) for sufficiently small values of theta, theta < π. Indeed we verify that the topological susceptibility has a non-zero large-N limit χ(&INFIN;) = 2A with corrections of O(1/N-2), in substantial agreement with the Witten-Veneziano formula which relates χ(&INFIN;) to the η' mass. Furthermore, higher order terms in θ are suppressed; in particular, the O(θ(4)) term b(2) (related to η' - η' the elastic scattering amplitude) turns out to be quite small: b(2) = 0.023(7) for N = 3, and its absolute value decreases with increasing N, consistently with the expectation b(2) = O(1/N-2).