Yes it would still be considered a capital gain (and you will have to pay tax) even though it was reinvested b/c it came out of the account.