I was thinking of creating an alien planet that orbits a star slightly past the habitable zone, but is kept warm by an extremely dense atmosphere, made primarily of a black gas, but still contains oxygen, nitrogen, and other gasses that support life on earth. If this is plausible, what gas could be the cause?
Nitrogen dioxide is a brown colored gas that seems to fit your scope.
However mind that a dark gas would stop light coming from the star, while to increase the planet temperature you want to stop the energy leaving the planet, creating the so called greenhouse effect.
Effective greenhouse gases are CO2, water and methane, which are transparent in the visible part of the EM spectrum while are opaque in the infrared.
During the 2003 wildfires in Southern California, you could look right at the sun and see sunspots. People were calling radio stations to ask what was wrong with the sun. Not a "black gas" but airborne solid carbon particles that filled the air.
In your world, these particles descend from space. Like tholins that form in the upper atmosphere of Titan and rain down on it, giving it an orange atmosphere, your planet is moving through great clouds of carbon monoxide and methanol that rain down and recombine as their enter your planet's atmosphere, mostly as tiny black carbon particulates of soot. Even in broad daylights the sun is dimmed by black clouds.
Soot is compatible with Earth-type life. Aquatic life would not care. Air breathers would need ways to avoid inhaling it, but that is not a big ask.
Rather than the atmosphere being a dark gas, you could have a dense, moist atmosphere that houses a lot of airborne microalgae. Earth's atmosphere contains some microalgae, at low as wellas high altitudes and in dry as well as wet climates, but not enough to visibly dim the sunlight. A thicker atmosphere could naturally hold more, especially if it has a high concentration of water vapor (which is an excellent greenhouse gas). This might imply that the surface on average is warmer than Earth's (15 C), but with less variation due to the thich atmosphere.
There could be several permanent cloud layers, each hosting their own species of microalgae, and each absorbing their own share of sunlight (microalgae are photosynthetic). The light on the surface would be murky, and the high temperature and moisture would make mist very likely.
Algae might fall to the surface during rainfall, making the rain a slightly nutritious soup that could be filtered for nourishment. The dark, warm, moist surface would be perfect for fungus.
It is not true what other have said that a black atmosphere would prevent the planet from absorbing sunlight. In fact, it will absorb all the sunlight, whereas Earth reflects about one-third of the sunlight it receives back into space. The atmosphere will transmit some energy to the surface as infrared light, but some will also radiate into space as infrared. In an equilibrium state, the planet will radiate as much energy into space as it receives. How much solar energy makes it to the ground is difficult to say.
Perhaps more importantly, a dense, dark atmosphere will limit how much heat from the planet's interior is lost into space. This helps keep the surface warm, sort of how a tea cosy keeps a teapot warm. This factor of course depends on the planet's interior temperature.