Every balance transfer I have seen always allocates any payments to the highest interest rate balance first. So you will pay a transfer fee and you will pay your normal interest on your 5,786 until it is completely paid. By that time the 0% offer will surely be over so you will pay the normal interest on that also AND the transfer fee.
If you want to actually benefit from the 0% Balance Transfer Offer, you should pay off the $5,786 first. Then do the balance transfer after considering what the real interest will be with the transfer fee and any interest that you will pay. Don't forget to find out if they have a "minimum interest charge" or if you will pay the normal interest on the transfer fee amount.
Don't forget to STOP USING THAT CARD or any new charges will get charged the normal interest rate until the very end.
You do realize that if you do a BT onto a cc that already has a balance that you will be paying off the amount with the lowest APR first, right? That means that you will be paying interest on the entire $5786 balance until the 0% balance is paid off.
Is the interest on the account you want to transfer to a LOT lower than the account you would be transferring from?