Aristotle believed that poetry and philosophy were more alike than they were to history, law, and factual accounts, since both seek truths or descriptions that are timeless--or, as Ezra Pound put it, "news that stays news."
Many early philosophers, such as Parmenides, wrote in verse, and this tradition continued up until Lucretius, at least. Nietzsche and Sartre wrote dramatic-poetic works, and poets like Dante, Donne, Blake, and Goethe wrote philosophical verse.
Though Plato's works can be quite poetic, he famously descried the philosophical poverty of the poets. His main target was Homer, whose heroes and gods portrayed impassioned, amoral actions, the very opposite of deliberation. And this shift away from verse and orality to the written word and dialectic was a crucial turn in philosophy.
Despite all this, I would say the two cannot really substitute for one another, unless we stretch definitions. It would be hard, perhaps impossible, to do good, innovative philosophy in poetic style and vice versa. Poetry may be good at synthesis, analysis not so much. While philosophy may use evocations and metaphors, it must strive for defined and explicit discourse.
Poetry, on the other hand, enriches itself according to how much can be left unsaid, elusive connections that we are forced to provide out of our own mental freedom without necessity or lawlike determinations. Poetry, as Dr. Johnson said of Milton, "delights to tread on the brink of meaning."