I think upgrading an award flight is OK, but you can't upgrade a flight that you had already upgraded (Y - J) with miles.
If the upgrade is indeed possible then yes, you can use your miles. Log in as yourself then select manage a booking using your friends name and PNR, or manage a booking first then your login credentials when prompted.