Writing about their findings in the journal Cell Death and Differentiation, the scientists expressed hopes that the treatment might work on humans too.
During the study, Dr. Costanza Emanueli and her colleagues injected the gene for Nerve growth factor (NGF) into the hearts of rats having a heart attack.
The treatment stopped heart cells from dying, the researchers said.
"This is the first time that a pro-survival effect of NGF in the heart has been found," the BBC quoted Dr. Emanueli as saying.
"Some other growth factors are already used clinically to treat different diseases, and our study shows that NGF may be a novel way of protecting the heart from further damage following a heart attack," she added.
Professor Jeremy Pearson of the British Heart Foundation, which provided funding for the work, said: "Dr Emanueli's research opens up the exciting and unexpected possibility of helping to repair damaged hearts by using a natural factor previously only thought to help nerves grow."