In this paper, an extended Gibbs relation is derived for the Boltzmann entropy (per unit volume) from the fundamental principles of general-relativistic kinetic theory of monatomic ideal gases, both classical and quantum. The discussion is based on the well-known extremum property of entropy and the additional observation which has certain elements in common with the infinite-dimensional version of a critical-point theory. As a matter of fact, the joint use of these two concepts enables us to define a privileged class of gas-state variables, the basic role of which is associated with the unique parametrization of the space of distribution functions and the exact decomposition of the relativistic Boltzmann entropy into equilibrium and nonequilibrium parts. By taking the infinitesimal variation of this decomposition, the derivation of an expression for the extended Gibbs relation can be carried out in a step-by-step analogy to the case of equilibrium thermodynamics. In standard textbook treatments of entropy, the method of moments is frequently used to obtain similar results. However, our approach can be viewed as providing a rule for how to understand the notion of an extended Gibbs relation without the need of expressing the distribution function in terms of its all moments.