In my humble opinion, depression and writing may, on occasion, happen to be responses to the same stimulus. But writing , or any other art, does not depend on great emotional turmoil. But for the most part, the pain just makes the art harder.
This idea is better put, here:
The idea that depression somehow feeds creativity is nonsense. Depression is a parasite. We all have limited reserves of energy, and mental illness drains these reserves.
Her point was further supported in this delightful snippet I stumbled upon at The Sun Magazine:
Why must every literary examination of Robert Lowell, of John Berryman, of Anne Sexton, of Jean Stafford, of so many writers and artists, keep perpetuating the notion that their individual pieces of genius were the result of madness? While it may be true that a great deal of art finds its inspirational wellspring in sorrow, let’s not kid ourselves about how much time each of those people wasted and lost by being mired in misery.— Elizabeth Wurtzel