if you want referencing, then name should be unique/primary key.
Let it is Primary Key, then also directly can't you insert the data.
One way is:- First insert the data and then Apply the foreign Key concept
Alternative :- First keep it with Some Dummy value, later update it !
( i didn't study it anywhere, it's my opinion )