Yes it does help because as your having sex with your loved one your brain releases Serotonin because you're feeling a lot of love and joy (hopefully ;]) . The reason why you're depressed is because your brain isn't releasing the desired amount of Serotonin. And not only are you not depressed during sex, you also are euphoric for a while afterwords.
However, if you're depressed and don't or cant see a doctor, I suggest trying an Herbal Supplement called St.John's Wort or Valerian Root which you can find at any store. It helps with depression and feelings of anxiety.