The fluctuation-dissipation theorem is a central result in statistical mechanics and is usually formulated for systems described by diffusion processes. In this paper, we propose a generalization for a wider class of stochastic processes, namely the class of Markov processes that satisfy detailed balance and a large-deviation principle. The generalized fluctuation-dissipation theorem characterizes the deterministic limit of such a Markov process as a generalized gradient flow, a mathematical tool to model a purely irreversible dynamics via a dissipation potential and an entropy function: these are expressed in terms of the large-deviation dynamic rate function of the Markov process and its stationary distribution. We exploit the generalized fluctuation-dissipation theorem to develop a new method of coarse-graining and test it in the context of the passage from the diffusion in a double-well potential to the jump process that describes the simple reaction $A rightleftarrows B$ (Kramers escape problem).