In Spanish you have the term homónimo
which takes a little bit further the connotations of a tocayo
homónimo, ma
- adj. Dicho de una persona o de una cosa: Que, con respecto de otra, tiene el mismo nombre. U. t. c. s.
The connotation is that another "Diego" is my tocayo
, but if what we share is the last name (apellido) instead of the first name, then that person would not be my tocayo
.
On the other hand homónimo
has that meaning of "same name as". To clarify, you could say
La Córdoba argentina y la española son ciudades homónimas.
(Fuente)
El equipo argentino River Plate deberá enfrentarse a su homónimo de Uruguay.
Foo Fighters ha debutado con un disco homónimo
Tom Hanks protagoniza el film “El código da Vinci” que es la adaptación cinematográfica del libro homónimo escrito en 2003 por el norteamericano Dan Brown.
(Fuente)
But you would not use "tocayos/as" in these cases. Notice that according to the definitio "tocayo" is used only for people while "homónimo" is used for people and things, which gives this latter one a boarder meaning. You could say, in reference to your example
Dédalo, el personaje de James Joyce, vive de acuerdo (o hace honor) a su homónimo mitológico.
You are more likely to find homónimo
if what matches is the last name (apellido) instead of the first name (nombre de pila). See for example this article in which Leonardo Mayer beats his namesake Florian Mayer.