Dividends are entirely separate from the capital gains. They are recurring payments, but don’t affect share price. You are not being double taxed on that amount.
If you sold a stock at $100 that you paid $50 for, you’d pay capital gains taxes on $50 no matter if the company paid you $0 dividends or $5 in dividends during the year. If you did get $5 in dividends, you’d then pay taxes on that, too.
Latest Answers