Capital gains over $583K?

Hello,

I’ve used an accountant for a few years to file taxes. With an upcoming home refinance, we’re planning to sell some stock from our brokerage account to put towards the mortgage principal.

I’m trying to understand how much would go to taxes from the sale. We live in NYC, and assuming a 15% long-term capital gains tax and 10% city/state taxes, we’d lose 25% to taxes. So, for every $100k sold, $25k goes to taxes, and $75k to the mortgage.

I asked my accountant if the stock sale counts as income and could trigger more taxes. He said it doesn’t, and as long as our W-2 income and stock sale total is below $583k (Married), the 25% tax is all we’d pay.

Before planning, is there a calculator or formula that would help confirm this?