The relation between the work performed to a system and the change of its free energy during a certain process is important in nonequilibrium statistical mechanics. In particular, the work relation with measurement and feedback control has attracted much attention, because it resolved the paradox concerning Maxwell's demon. Most studies, however, assume that their target systems are isolated or isothermal. In this paper, by considering a nonisothermal system, we generalize the Sagawa-Ueda-Jarzynski relation, which involves measurement and feedback control, and apply it to a realistic model. Furthermore, when the temperature profile is quadratic, we see that the system is governed by Tsallis statistical mechanics. In addition, we show that our formulation provides the generalized version of the second law of information thermodynamics and a set of new work relations for isothermal systems.