Line intensity mapping (LIM) can provide a powerful means to constrain the theory of gravity and the nature of dark energy at low and high redshifts by mapping the large-scale structure (LSS) over many redshift epochs. In this paper, we investigate the potential of the next generation ground-based millimeter-wavelength LIM surveys in constraining several models beyond $\Lambda$CDM, involving either a dynamic dark energy component or modifications of the theory of gravity. Limiting ourselves to two-point clustering statistics, we consider the measurements of auto-spectra of several CO rotational lines (from J=2-1 to J=6-5) and the [CII] fine structure line in the redshift range of $0.25Comment: 20+3 pages. 15 figures. 3 tables