Welcome to Just Answer,
You can't sell 401K stock. You take a distribution. 401K accounts do not pay capital gains tax. The IRS eliminates the payment of capital gains inside of your 401k because the plan meets the requirements of the IRS to qualify as a qualified retirement account.
401K distribution would be ordinary income.
The loss on the sale of your investment property would recieve 1231 treatment in regards XXXXX XXXXX loss.
I hope this helps.
I need some clarification, please. If I closed my 401K of $500K and withdrew $250K via the sale of my company stock, would the 15% tax on the stock appreciation (in this case-$100K) be offset by the loss on the sale of my rental property? I am aware that the $150K would be subject to the ordinary income tax rate. Or are you saying that a captial gain on stock sales cannot be offset by a loss on the sale of investment property?