Personally I loved the concept of the good guys failing. It just showed yet again DS9 was willing to think outside of the box. Strictly speaking, as has been pointed out, the Prophets interfering is not an Ex Deus Machina simply because they -are- an existing story element. An Ex Deus Machina would've been if there never were any aliens in the wormhole for the whole series, then suddenly we have the Bajoran Gods appear out of no where and win the day.
My main disappointment with the episode was virtually the lack of followup. The Prophets bailed him out, but menacingly declared there would be a price to pay. I guess you could vaguely interpret that to be his little spirit quests in season 7, but it really doesn't pan out and really fizzles away slowly.