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  if the total of your
withholding and timely estimated tax payments didn't equal at least
the smaller of:
90% of your  tax, or
100% of your 2017 tax. Your  tax return must cover a 12-month period.
Higher income taxpayers.
If your adjusted gross income (AGI) for  was more than $150,000
($75,000 if your  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.