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 Λ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.25<z<12. We consider different models beyond ΛCDM, each one with different signatures and peculiarities. Among them, we focus on Jordan-Brans-Dicke and axion-driven early dark energy models as examples of well-studied scalar-tensor theories acting at late and early times respectively. Additionally, we consider three phenomenological models based on an effective description of gravity at cosmological scales. We show that LIM surveys deployable within a decade (with ∼10^8 spectrometer hours) have the potential to improve upon the current bounds on all considered models significantly. The level of improvements range from a factor of a few to an order of magnitude.