The Apostle John is recounting a story many years later. This is the Apostle John's writing style for detail as he writes. The Apostle John always puts a detail that shows he was present and saw these things. After all, only a witness can tell these things. To be fair, John does recount specifics and chances are, he either was not present in the Luke parable or he did not think it was important for his Gospel. The woman's name in Luke 7 is intentionally left out by Dr. Luke.
I agree that Luke never names the woman in Luke 7. But that's not unusual. The Gospel writers sometimes identify a person by name in one place and leave them unnamed in another, even when they are clearly referring to the same individual. So the fact that Luke does not name the woman in Luke 7 does not by itself prove she was not Mary.
I agree that John often includes details that suggest eyewitness testimony. But John 11:2 is serving a different function. It's not presented as an eyewitness detail. It's presented as an identifier while John is introducing Lazarus, Martha, and Mary. In that introduction, John identifies Mary as "the one who anointed the Lord and wiped His feet with her hair." Normally, when an author introduces a character, he identifies them by something the audience already knows, not by an event he has not yet narrated.
If John is referring only to the anointing in John 12, then he is introducing Mary by a future event that the reader has not yet read about.
So why use that description as her identifying marker?
And why choose the distinctive combination of anointing Jesus' feet and wiping them with her hair, a combination otherwise found in Luke 7?
John 11:2 seems to assume the description is already meaningful to the reader, which is what needs to be explained.