No, the income and expenses from a property are related. The outcome from your example is a tax deduction of $5000, not income oif $15,000 and deductions of $20,000.
But that's not the point. The question relates to interest deductibilty, which is determined by the underlying use of the loan...