I have my old passport which has my old last name on it. My new passport has my new last name. It also has a reference to my old passport number. Would that help ?
It could be helpful but it really depends on the adjudicating officer. I would get the official document (judgment, decree, etc.) stating that pursuant to A's request, your name was changed from X to Y.