I would think -- but this is for the moment a thought, not meant as an authoritative answer -- that _every_ notion of cohomology whatsoever has a relative version in this sense.

I am thinking here of the general abstract definition of cohomology as exposed at <a href="https://ncatlab.org/nlab/show/cohomology">nLab:cohomology</a>.
This includes in particular the special case of <a href="https://ncatlab.org/nlab/show/abelian+sheaf+cohomology">sheaf cohomology</a> as described there in some detail.

What I expect the fully general notion of relative cohomology from this point of view to be I have now briefly indicated at <a href="https://ncatlab.org/nlab/show/relative+cohomology">relative cohomology</a>. I'd believe this does in particular reproduce the definition given in Emerton's answer.