Upon closer examination I believe it's actually unlikely it's the Yorktown
as we just saw that ship earlier in the movie:
CARTWRIGHT: We don't know. Get me the Yorktown.
YORKTOWN CAPTAIN: (on viewscreen) Emergency channel zero one three zero. Code red. It has been three hours since our contact with the alien Probe. All attempts at regaining power have failed.
CARTWRIGHT: It's using forms of energy we do not understand.
FEDERATION PRESIDENT: Can you protect us?
CARTWRIGHT: We are launching everything we have.
YORKTOWN CAPTAIN: (on viewscreen) Our systems engineers are trying to deploy a makeshift solar-sail. We have high hopes that this will, if successful, generate power to keep us alive.
Theoretically, everyone aboard Yorktown
might have suffocated in the icy cold of space, so you had an empty starship looking for a new captain.
On the other hand Scotty's remark of the E-A being a "new ship" (in the subsequent movie) seems to contradict this idea.