Gifted programs track students, accidental or not, based on prerequisites. If the circumstances required to allow a student to excel at study are not met, it doesn't matter what they look like or what their economic status is.
Among the prerequisites for excelling at study are a stable home life and parents (or guardians) that value education. If the kids don't have that, they aren't going to do well.
Historically, at least in the United States, one of the means of selecting for "parents who value education" was those parents scraping everything they had to move to a school district that provided a better education.
In other countries, this was sometimes achieved by scoring students into tiered schools. The higher your score, the better the school you got to go to. High-achieving students landed in a peer group of like-minded students that were fellow high-achievers and school was difficult.
Granted, that last solution was more typical of Asian education than Western education, and in some parts of Asia (China, for example) they have slipped into the location-based schooling to worse results.
Aiming for equity with the assumption that we just need to teach harder is foolish. Aiming for equity in the form of outcomes is equally foolish, because again, various outcomes have various hard prerequisites that, if missing, no amount of effort can overcome.
Solving for the prerequisites, not by attempting to ignore them, but by finding ways to help supply them can be far more productive in the long run. But it really starts with the values of the parents.