The Medrash (quoted by the Chida zt”l in Sefer Lechem Min Hashamayim) relates that Osnas was the daughter of Dina and Shchem. The Shevatim wanted to kill her, so Yaakov Avinu hung a kamea around her neck and sent her away. She went and hid amongst the bushes, and she was called “Osnas” after the “sneh” (bush) where she hid.
Gavriel came and took her to Egypt, depositing her with the wife of Potiphar. When Yosef came to Mitzrayim, all the women came to gaze at his beauty. Each one threw a piece of jewelry or some other item at him, and Osnas threw that amulet. When Yosef saw it, he knew she was Yaakov’s granddaughter, so he married her.
Chazal tell us (Yevamos 62B) that if someone marries his brother’s daughter, we apply to him the pasuk (Yeshaya 58:9): “When you shall call and Hashem shall answer, you shall cry and He shall say, ‘Here I am’.” Thus, Yosef certainly merited at that time to have all his tefillos accepted and fulfilled.
As an aside, the same Gemara states that this pasuk is applied to three things: One who draws close his relatives, one who marries his brother’s daughter, and one who lends money to a poor man in his time of need. It is said that all three of these things go against a person’s nature, and one must push himself to do them, which is why Hashem says that He will answer this person’s tefillos even if he is not really deserving.
It goes against one’s nature to marry his brother’s daughter, as a person naturally wants to find the most respectable family to marry into. It also goes against one’s nature to lend money to a poor man because, as Sefarim Hakedoshim, explain this is referring to someone who also is going through a hard time. If he doesn’t have much for himself but still lends some money to someone else, that is going against his nature.
Drawing close one’s relatives also goes against one’s nature as people normally can’t stand to be around relatives more than they have to. It is known that the Gorlitzer Rebbe zy”a once asked (quoted in Divrei Torah, Mahadura 9, Ois 26) why the Torah needs to have two separate commands – one of “v’ahavta l’reacha komocha” (Vayikroh 19:18) and one of “lo sisnah es achicha b’levavecha” (do not hate your brother in your heart, Vayikroh 19:17). If one must love everyone, why does it have to reiterate that one may not hate his brother? The answer is that even if one loves everyone, it is harder to love one’s brother, as brothers often get into fights over inheritances or out of jealousy, etc. Therefore, the Torah needs to stress that even if one cannot love his brother, he at least should not hate him.