From the entry for
Nancy:
Previously a medieval diminutive of Annis, though since the 18th century it has been a diminutive of Ann.
Annis is a medieval form of
Agnes, so I'd say
Anna and
Nancy are closely related, the same for
Agnes and
Nancy, though the relation between the latter is archaic.
This reminds me of
Jenny, which it used to be a diminutive of
Jane.
“Dear optimist, pessimist, and realist – while you guys were busy arguing about the glass of wine, I drank it! Sincerely, the opportunist!”
-Lori Greiner