Ultra-intense short-pulse light sources are powerful tools for a wide range of applications. However, relativistic short-pulse lasers are normally generated in the near-infrared regime. Here, we present a promising and efficient way to generate tunable relativistic ultrashort pulses with wavelengths above 20 µm in a density-tailored plasma. In this approach, in the first stage, an intense drive laser first excites a nonlinear wake in an underdense plasma, and its photon frequency is then downshifted via phase modulation as it propagates in the plasma wake. Subsequently, in the second stage, the drive pulse enters a lower-density plasma region so that the wake has a larger plasma cavity in which longer-wavelength infrared pulses can be produced. Numerical simulations show that the resulting near-single-cycle pulses cover a broad spectral range of 10–40 µm with a conversion efficiency of ∼2.1% (∼34 mJ pulse energy). This enables the investigation of nonlinear infrared optics in the relativistic regime and offers new possibilities for the investigation of ultrafast phenomena and physics in strong fields.