In the context of mathematical cosmology, the study of necessary and sufficient conditions for a semi-Riemannian manifold to be a (generalized) Robertson-Walker space-time is important. In particular, it is a requirement for the development of initial data to reproduce or approximate the standard cosmological model. Usually these conditions involve the Einstein field equations, which change if one considers alternative theories of gravity or if the coupling matter fields change. Therefore, the derivation of conditions which do not depend on the field equations is an advantage. In this work we present a geometric derivation of such a condition. We require the existence of a unit vector field to distinguish at each point of space two (non-equal) sectional curvatures. This is equivalent for the Riemann tensor to adopt a specific form. Our geometrical approach yields a local isometry between the space and a Robertson-Walker space of the same dimension, curvature and metric tensor sign (the dimension of the largest subspace on which the metric tensor is negative definite). Remarkably, if the space is simply-connected, the isometry is global. Our result generalizes to a class of spaces of non-constant curvature the theorem that spaces of the same constant curvature, dimension and metric tensor sign must be locally isometric. Because we do not make any assumptions regarding field equations, matter fields or metric tensor sign, one can readily use this result to study cosmological models within alternative theories of gravity or with different matter fields.