Three ways to avoid the estimated tax penalty, your pick:
(1) pay all that's owed in estimated taxes. I like to pay in Apr and Dec, and oddly it seems to work.
(2) pay at least as much as last year. If you owed $10k last year, make sure you've paid at least $10k this year (with W-2 withholding or estimated taxes)
(3) pay 90% of what you owe this year. Maybe you owed $30k last year, but this year you only owe $20k. You need to pay at least $18k to avoid penalties.
As to how long-term capital gains are calculated, think of it as subtracting the end point from the starting point, which almost never starts at zero. Someone with $100k income paying $50k in long-term gains, would take the tax owed on $150k and subtract the tax owed on $100k. If it's all under $200k, it doesn't matter much.
But someone with $420k income has to compare $470k minus $420k. They pay about $30k at the 20% tax rate, and about $20k at the 15% tax rate. The capital gains tax stands on top of regular income to determine the bracket. Note in this case, there's also the "net investment income tax" of 3.8% on all gains over $200k, so the effective capital gains tax rates are 18.8% and 23.8%.