Margin interest is not deducted from capital gains generated in the account. It's an itemized deduction and can only be deducted if your total itemized personal deductions exceed your standard deduction.
Another limitation on this deduction would be the fact that it can only be deducted up to the amount of investment income you have, that is taxed at ordinary income rates, not lower capital gains rates.
You may be able to adjust your investment expenses upward for this interest if you complete the AMT interview under other Tax Situations.