Bible scholar Dan McClellan is on youtube and does short videos rebutting popular youtube/tiktok videos that make claims that aren't historical. Dan has said that the four names were not assigned to the texts until the second half of the 2nd century, probably around 180CE or so. That leaves 80-100 years where the books were in circulation before the naming convention was established.
The subject of authorship comes up frequently so he has addressed it a few times, but here is a short (under 7 minute) video. It isn't just an assertion, he gives reasons why he makes these claims:
"Data over dogma." Dr. Dan McClellen is an engaging source for historically accurate interpretations and understandings of the bible. I encourage others to check his content out.
There’s a big difference between the gospels not being cited by name directly, and not having a name. For example, the Gospels often cite Isaiah without using his name - just lifting direct quotes.
And there’re allusions to apostolic naming in things like Justin Martyr’s first apology, Ch67 (155CE, dating largely from it being co-addressed to Marcus Aurelius):
“ the memoirs of the apostles or the writings of the prophets are read, as long as time permit”
https://www.ccel.org/ccel/schaff/anf01.viii.ii.lxvii.html