I don't know if this is the best way to solve it, but it was how I manage to pull this off.
Every time you are going to change the text, check if it's overlapping the object it's related to. This will select the text instance that is related to this particular object.
Hope it helps o/