On each roll, the probability of total 5 is $4/36$, and the probability of total 7 is $6/36$.
Notice that if Nancy rolls any total other than 5 or 7, her situation has not changed at all: she still needs to keep rolling until the dice show 5 or 7, and will get the same results. So her probability of a win after that roll is the same as it was before.
$P(\mbox{win}) = P(\mbox{roll 5}) P(\mbox{win} \mid \mbox{roll 5}) +P(\mbox{roll 7}) P(\mbox{win} \mid \mbox{roll 7}) + P(\mbox{roll other}) P(\mbox{win} \mid \mbox{roll other})$
$P(\mbox{win}) = \frac{4}{36} \cdot 1 + \frac{6}{36} \cdot 0 + \frac{26}{36} P(\mbox{win})$
$\frac{10}{36} P(\mbox{win}) = \frac{4}{36}$
$P(\mbox{win}) = \frac{2}{5}$.