Previous episodes ("Prophet Motive", "Accession") had established that stopping in the wormhole brought about contact with the Prophets. Sisko also attempts to help the Prophets in "The Reckoning" for their actions in stopping the Dominion fleet.
Memory Alpha quotes Ira Steven Behr from the DS9 Companion:
"I felt it was the perfect next step in the evolution of the relationship between Sisko and the Prophets that began in the pilot. Hearing people refer to it as some dopey deus ex machina is really annoying because I would think they'd give us more credit for being on the ball. We didn't have to end it like that, we chose to end it like that. Because we wanted to say that there was something going on here. And ultimately, that would lead to our finding out that Sisko is part-Prophet. They wouldn't have done this for just anyone. This was the man going out into the wilderness and demanding God to interfere, to do something for crying out loud. The corporeal characters had done so much in the episode; surely they'd earned the help of the gods.