It could also be related to Naruto's own strong will and connection to his parents. In the fanfiction, his intense longing for his parents might awaken some latent power within him that has the ability to reverse death. This power could be tied to the Uzumaki bloodline, which is known for its unique and often mysterious abilities.
One way could be through some powerful forbidden jutsu. Maybe he discovers a long - lost scroll that contains a jutsu specifically designed to bring back the dead. However, such a jutsu would likely come with a great cost, like sacrificing a large amount of his own chakra or even his life - force.