There’s an ambiguity in scholarship as to whether the writer of John knew of Mark’s narrative. I personally don’t think so, but I do think that John knew of some sort of Synoptic Gospel.
First, there are two oddities in John that would only be explained if John knew of some sort of Synoptic gospel. When I mention “a” Synoptic gospel, I don’t mean just Mark, Matt, or Luke. There were other variations in 2nd century Christianity so John might not have known what we now read as Mark, Matt, or Luke. John could have been aware of say the Ebionites’ version of Matthew, or the gospel of the Hebrews, or some other “heretical” version of a Synoptic.
Anyway, the two oddities that I think show that John knew of some sort of Synoptic(s) and was trying to tie his narrative into theirs are “Nazarene” and the phrase “Kingdom of God”. These two are littered all throughout the Synoptics, but make very few appearances in John. “Kingdom of God” is only found twice – in John chapter 3 (arguably the most famous chapter in all Christianity). John says that no one can see the “Kingdom of God” unless they are born from above (3:3 and 3:5). After this chapter, John never mentions the Kingdom of God ever again.
Now there are probably two gospels that I’ll rule out for John being aware of. First, even though it’s very weak evidence, John doesn’t seem to be aware of Mark’s Nazarene (Ναζαρηνος). John never once writes the word “Nazarene”. He writes either Nazareth (Ναζαρεθ) or Nazoraios (Ναζωραιος). Neither of these phrases are found in Mark (“Nazareth” technically is, but I argue that it’s not original to Mark). So John must have gotten his Nazareth and Nazoraios from some other source.
Second, John doesn’t seem to be aware of Matthew’s “Kingdom of Heaven”. Matthew has a preference for saying “Kingdom of Heaven” instead of Mark’s “Kingdom of God”. Matt only uses “Kingdom of God” twice when not directly quoting from Mark or Luke/Q (or their common source). So if John was aware of Matthew, he would have used that phrase in his “born from above” speech to Nicodemus in chapter 3.
However, the three times that John uses the word Ναζωραιος (18:5,7; 19:19) he uses it how Mark would say “Nazarene”, i.e. Jesus the Nazarene. And the two times that he uses Nazareth he’s actually describing the town without the qualifier. 1:46 Nathan’s response about the town by itself without the association with Jesus depends on Phil mentioning it at 1:45 so to be consistent the spelling would have to be consistent. Matthew describes Jesus as having to be a Nazarene to fulfill what was said in the prophets. However, Matt uses Ναζωραιον, which he probably got from recalling Judges 13:5 from memory (Ναζιραιον).
Now if, as many NT scholars claim, there’s a documentary relationship between the gospels, and Mark is first, then the word (Ναζωραιον) “Nazoraion” enters the synoptic tradition via Matt. Now, the only gospel left that John could be aware of is Luke/Marcion. If Nazoraion is original to Matt, then any gospel with that phrase also has to share a documentary relationship with Matt.
Luke only uses Nazoraion once – at 18:37: ιησουν τον ναζωραιον in a parable about a blind man receiving his sight:
35As Jesus approached Jericho, a blind man was sitting by the roadside begging.
36When he heard the crowd going by, he asked what was happening.
37They told him, “Jesus of Nazareth [i.e. ιησουν τον ναζωραιον] is passing by.”
38He called out, “Jesus, Son of David, have mercy on me!”
39Those who led the way rebuked him and told him to be quiet, but he shouted all the more, “Son of David, have mercy on me!”
40Jesus stopped and ordered the man to be brought to him. When he came near, Jesus asked him,
41″What do you want me to do for you?” “Lord, I want to see,” he replied.
42Jesus said to him, “Receive your sight; your faith has healed you.”
43Immediately he received his sight and followed Jesus, praising God. When all the people saw it, they also praised God.
This just so happens to be one of the seven miracles that Jesus does in John – a blind man being given sight. But it’s very unlike the miracle in John; John’s miracle is closer to how Mark cures someone of blindness (Mk 8:22-26).
John and Luke also have other similarities beyond the more superficial like the phrase “Kingdom of God” – Luke also uses the word “Nazareth”. John and Luke downplay the little apocalypse in Mark 13/Matt 24. Luke and John both have anti-Docetae resurrection appearance by having him eat fish and showing his crucifixion injuries.
One final and probably most important relationship between John and Luke is who seems to be the first Christian witnesses to these gospels. Valentinus and Marcion, respectively, seem to be the “heretics” who used these two gospels first, and both were Docetists. I’ve even heard that the two might have collaborated with each other, but that’s just hearsay.
So, in my opinion, it seems as though the author of John either knew Luke, knew some sort of proto-Luke (i.e. Marcion), or knew of our current Luke’s source.