You must first use your stock losses to offset capital gains. Then, if you have any excess capital loss, up to $3,000 of it may be used per year to offset ordinary taxable income, which may include dividends.
**Answers are correct to the best of my ability but do not constitute tax or legal advice.