You should be paying the taxes on the 990-T from the IRA funds and not from outside IRA sources. Doing it that way reduces the income in the IRA so you naturally don't pay taxes a second time.
You want to avoid UBTI, because the IRA owner essentially is taxed twice on it. The IRA will be taxed on the income. Subsequently, the owner or beneficiary will be taxed on distributions of that income. No deduction or credit is available to the owner for UBTI paid by the IRA and the tax is not added to the tax basis of the IRA.
What if a merger occurred of stock held in an IRA which results in a loss from stock purchased prior to merger? Example; stock A was purchased at $40 in IRA. Stock A dropped to $10 per share. Stock A was merged with Stock B at a .33 rate of shares (100 shares gets 33 shares of new stock). Then the custodian files a 990T which shows UBIT on the merger plus a schedule D showing capital gains. How is the $30 per share loss on Stock A accounted for? There was no capital gain. However, there was a loss on capital gain.
Assuming that this is a traditional IRA, the loss in value of stock A prior to the merger is an amount on which you will never pay taxes because it's an amount that will never be distributed from the IRA, the same as if there had been no merger.