When a gain system is coupled to a loss system, the energy usually flows from the gain system to the loss one. We here present a counterintuitive theory for the ground-state cooling of the mechanical resonator in optomechanical system via a gain cavity. The energy flows first from the mechanical resonator into the loss cavity, then into the gain cavity, and finally localizes there. The energy localization in the gain cavity dramatically enhances the cooling rate of the mechanical resonator. Moreover, we show that unconventional optical spring effect, e.g., giant frequency shift and optically induced damping of the mechanical resonator, can be realized. Those feature a pre-cooling free ground-state cooling, i.e., the mechanical resonator in thermal excitation at room temperature can directly be cooled to its ground state. This cooling approach has the potential application for fundamental tests of quantum physics without complicated cryogenic setups.