You would need to make an election to have your capital gains treated as investment income in order to be able to offset it against your investment interest deduction.
But be aware, if you make this choice, your capital gains in the future would be taxed at ordinary tax rates as opposed to using the preferential capital gains rates currently in effect.
Investment income & expenses publication
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"