Warning: this answer contains spoilers for both Venom: Let There Be Carnage and Spider-Man: No Way Home.
Eddie's initial transference to the MCU seemingly occurred in the mid-credits scene of Venom: Let There Be Carnage.
Eddie is lying on a bed watching a soap opera on television, when the symbiote mentions that it has a past that Eddie doesn't know about, including "80 billion light-years of hive knowledge across universes".
It decides to give Eddie a taste of this knowledge, and just as that happens, there's a distortion effect around the room, and Eddie suddenly finds himself lying on a bed in a different room, where J. Jonah Jameson is on TV, reporting on the reveal of Spider-Man's secret identity.
Eddie then assumes his Venom form, walks over to the TV screen -- which is showing a close-up of an unmasked Spider-Man's (Tom Holland's) face -- and the symbiote says "That guy..." and licks the screen, possibly signifying some degree of recognition.
SYMBIOTE: Oh, I love this show.
EDDIE BROCK: Yeah.
SYMBIOTE: Maximiliano’s feelings are not being validated.
EDDIE BROCK: Yeah, well, he never should’ve kept such an insane secret, man.
SYMBIOTE: We all have a past, Eddie.
EDDIE BROCK: What, are you… you hiding stuff from me?
SYMBIOTE: 80 billion light-years of hive knowledge across universes would explode your tiny little brain.
EDDIE BROCK: What-what does that even mean, man?
SYMBIOTE: Well, let me give you a taste, then. Just the smallest fraction of the things we symbiotes have experienced.
EDDIE BROCK: Okay.
SYMBIOTE: Ready, Eddie?
EDDIE BROCK: Yeah.
SYMBIOTE: Whoa. What’s happening?
EDDIE BROCK: No, no, no, no. No, no, no, no, no.
SYMBIOTE: What the hell is that?!
EDDIE BROCK: Oh, that’s a… that-that’s just a towel. Where are we? Wh-What did you do?
SYMBIOTE: It wasn’t me.
J. JONAH JAMESON [on television]: Incredibly, this shocking revelation brought to life by yours truly has only raised…
EDDIE BROCK: What? What-what... what is this?
J. JONAH JAMESON [on television]: …of Peter Parker, aka Spider-Man, aka the Spider Menace. But rest assured, dear viewers, we here at The Daily Bugle will...
SYMBIOTE: That guy...
Venom: Let There Be Carnage (2021)
The implication of all this seems to be that the symbiote -- through a hive mind link with symbiotes in other universes -- had knowledge of the Peter Parker/Spider-Man of another universe, and that when it shared this knowledge with Eddie, both of them unwittingly became subject to the spell cast by Dr. Strange in Spider-Man: No Way Home.
It's conceivable that the symbiote specifically knew about the Tobey Maguire version of Peter Parker/Spider-Man, via a hive mind link with the Venom symbiote of that universe. That would make a degree of sense, since the two Venom films and the three Tobey Maguire Spider-Man films are all Sony Pictures productions. There's no specific indication that that's what they were going for though.
It could also be that there are symbiotes within the MCU/Sacred Timeline itself, and that one or more of them somehow know about the Tom Holland version of Peter. The possibility that it knew about the Tobey Maguire version, rather than the Tom Holland version, feels like less of a stretch to me, but these last two paragraphs are nothing more than speculation at this point.