Back In The Day.
Unfortunately, we can't really give a much more detailed answer than that. We know that Yuyuko lived her mortal life and died about 1000 years ago, and that Yukari knew her when she was still alive...but we don't know what their relationship was at that time.
A popular theme among doujinshi artists who do Yuyuko / Yukari stories seems to be that the two became fast friends while Yuyuko was still alive, as Yuyuko had supernatural power over death even then, and while humans shunned her, Yukari accepted her. However, that's fan speculation, and it's possible that the two didn't become close until well after Yuyuko's death.