The Egyptians originally coined the name "Peoples of the Sea" for the foreign contingents that the Libyans brought in to support their attack on Egypt in c. 1220 BC during the reign of Pharaoh Merneptah [see New Kingdom: 19th Dynasty]. In the records of that war, five Sea Peoples are named: the Shardana, Teresh, Lukka, Shekelesh and Ekwesh, and are collectively referred to as "northerners coming from all lands". The evidence for their exact origins is extremely sparse, but archaeologists specializing in this period have proposed the following:
The Shardana may have originated in northern Syria, but later moved to Cyprus and probably eventually ended up as the Sardinians.
The Teresh and Lukka were probably from western Anatolia, and may correspond to the ancestors of the later Lydians and Lycians, respectively. However, the Teresh may also have been the people later known to the Greeks as the Tyrsenoi, i.e., the Etruscans, and already familiar to the Hittites as the Taruisa, which latter is suspiciously similar to the Greek Troia. I won't speculate on how this fits in with the Aeneas legend.
The Shekelesh may correspond to the Sikels of Sicily. The Ekwesh have been identified with the Ahhiyawa of Hittite records, who were almost certainly Achaean Greeks colonizing the western coast of Anatolia, as well as the Aegean Islands, etc.
In Egyptian records of the second wave of Sea Peoples attacks in c. 1186 BC, during the reign of Pharaoh Rameses III, the Shardana, Teresh, and Shekelesh are still considered to be a menace, but new names also appear: the Denyen, Tjeker, Weshesh and Peleset. An inscription mentions that they "made a conspiracy in their islands", but these may have only been temporary bases, not their actual homelands.
The Denyen probably originally came from northern Syria (perhaps where the Shardana had once lived), and the Tjeker from the Troad (i.e., the area around Troy) (possibly via Cyprus). Alternatively, some have associated the Denyen with the Danaoi of the Iliad, and even the tribe of Dan in Israel.
Little is known about the Weshesh, though even here there is a tenuous link to Troy. As you may know, the Greeks sometimes referred to the city of Troy as Ilios, but this may have evolved from the Hittite name for the region, Wilusa, via the intermediate form Wilios. If the people called Weshesh by the Egyptians were indeed the Wilusans, as has been speculated, then they may have included some genuine Trojans, though this is an extremely tenuous association.
Finally, of course, the Peleset eventually became the Philistines and gave their name to Palestine, but they too probably originated somewhere in Anatolia.
In summary then, five of the nine named "Sea Peoples" - the Teresh, Lukka, Tjeker, Weshesh and Peleset - can plausibly be linked to Anatolia (albeit somewhat inconclusively), with the Tjeker, Teresh and Weshesh being possibly linked to the vicinity of Troy itself, though nothing can be proven and there's still much controversy about the exact locations of ancient states in that region, let alone the ethnic identity of the inhabitants.
Of the other four Sea Peoples, the Ekwesh are probably the Achaean Greeks, and the Denyen may be the Danaoi (though probably aren't), while the Shekelesh are the Sicilians and the Shardana were probably living in Cyprus at the time, but later became the Sardinians.
Thus, both sides in the Trojan War may be represented among the Sea Peoples, but the impossibility of obtaining precise dates for the fall of Troy and the raids of the Sea Peoples makes it difficult to work out exactly how they are connected.