I am assuming the capital gains was becasue you sold a stock in 2018, and that this is a one-off event.
Then safe harbor rules our your friend to avoid the underpayment penalty:
Who Must Pay the Underpayment Penalty
In general, you may owe the penalty for [2018] if the total of your
withholding and timely estimated tax payments didn't equal at least
the smaller of:
90% of your [2018] tax, or
100% of your 2017 tax. Your [2017] tax return must cover a 12-month period.
Higher income taxpayers.
If your adjusted gross income (AGI) for [2017] was more than $150,000
($75,000 if your [2017] filing status is married filing separately),
substitute 110% for 100% in (2) above.
So if you can adjust your withholding on your wages by decreasing the number of allowances, or by having extra money withheld from each paycheck, tom make the safe harbor, then it doesn't matter how much the capital gains is, there will be no penalty next April. Making sure you make the safe harbor means that you can avoid the quarterly tax payments, and having to calculate the expected capital gains now with more than 6 months left in the tax year.
Now for the bad news. In calendar year 2019 you will have to either make the higher safe harbor again by keeping the higher withholding or make sure that you don't owe more than $1000 in April 2020.
Some years ago when I sold a property with a large capital gains, I made the adjustment to my withholding to make sure I made the safe harbor. Then I made a payment of over $10K to the IRS with my tax return. There was no penalty. Of course I had to be careful that I didn't owe a large amount the next year by making sure I over withheld.