The better way to think about this is actually that the myth really only developed in response to the interactions between Greeks and Romans starting in the third century BCE. The first indications we have of Italians with a relation to the Trojan War is actually in Hesiod, and the Latins are descended not from Trojans but from Odysseus. However, from a pretty early date the Etruscans (who are certainly not Greek, as they would have conceived it) begin to see themselves as related to Trojans and Aeneas. We can see that over the course of the third and especially the second centuries BCE Romans try to figure out what the deal was with their past, and try to fit their own native myths into the chronology of Greek history. They want to legitimize themselves on the world stage. One of the ways they do this is to trace their founding myths back to Troy. The first person we know of who explicitly claims this is the first Roman historian Quintus Fabius Pictor, who, as fitting for a historian of this type of events, actually wrote in Greek, not Latin.
This requires a little jimmying of the timeline because they know that Romulus supposedly lived a good 400 years after the fall of Troy, so he can't have been a refugee from the city. So there has to be this weird double myth where Aeneas comes to Latium and then basically nothing happens for 400 years until the whole Numenor, Rhea Silvia, Mars, twins, wolf, etc. story happens. (Ok, some stuff happens--the Latin kings of Alba Longa. But really nothing). So in the end you have the amalgamation of what had ben quite disparate myths (Romans also have an early relation with Hercules, who kills a monster on the Palatine Hill) into one sort of coherent saga. This of course reaches its apogee with Virgil in the first century BCE. But we shouldn't think of the Romans as having pristine myths that they then told the Greeks when they encountered them. There is a constant renegotiation of identity during this period as civilizations come into contact with each other.
Basically, these myths were constantly used and reworked for different purposes. But rather than think about them as things that always existed and were brought out for specific purposes, we have to think of them as in dialogue and flux. In this case, the myth of Troy was actually used to bring Romans closer to Greeks by giving them a shared history, albeit one that could still differentiate them.
Sources: Tim Cornell The Beginnings of Rome
You can get a pretty good sense of how ethnic identity was used from Gary D. Farney, Ethnic Identity and Aristocratic Competition in Republican Rome (Cambridge University Press, 2007)