Under some conditions, radiation can be modelled as a fluid with a proper equation of state. The idea is that the photon gas should be close to equilibrium with a second fluid (matter), making the total system a "multifluid". More technically, one should start from kinetics and perform some closure, otherwise one should use pre-hydrodynamic models for the photons. All this, and what follows, is discussed in Multifluid Modelling of Relativistic Radiation Hydrodynamics and references therein. This preamble is just to say that the question has a definite answer only if some matter field is also present and under certain conditions discussed in the linked paper or the sources mentioned therein.
The simplest case is when the radiation fluid is modelled as an ideal ultrarelativistic gas. In this case, the relation
$P=\epsilon/3$, where $\epsilon$ is the energy density, is the equation of state for the photon component of the multifluid: this equation of state is valid for any ideal ultrarelativistic gas, both Bosonic or Fermionic (i.e. it is valid as long as we are in a limit where we can ignore mass or in a genuinely massless case).
In fact, $P=\epsilon/3$ is even more general: it can be used as an equation of state, but also as a kinematic identity (it is valid also out of thermodynamic equilibrium because it is a requirement stemming from the fact that the energy-momentum tensor of photons is traceless!). The real difference between the equilibrium and non-equilibrium case is the fact that at equilibrium (i.e. in the black-body case, see this answer for the difference with the non-equilibrium case) we know that the energy density is proportional to the 4th power of the temperature: $\epsilon \propto p \propto T^4$, see e.g. this question.