Consider a tree rooted at with left child and right child . Node has children and . Node has children and . Find LCA(, ). Call on root . Left subtree returns (found target). Right subtree returns (found target). Both are non-null, so is the LCA.
Now find LCA(, ) where is a child of . Call on root . Left subtree finds first and returns it. But is also in the left subtree under . The left call returns (since is encountered before reaching 's subtree). Right returns null. So is the LCA. Node is an ancestor of , confirming the answer.