Answer
$7$
Work Step by Step
Recall the change-of-base rule for lograithms:
$$\log _{b}c=\frac{\log _{a}c}{\log _{a} b}$$
Thus, using the rule above gives:
$$\log _{8} 7=\frac{\log _{5} 7}{\log _{5} 8}$$
Therefore,
$$\log _{8} M=\frac{\log _{5} 7}{\log _{5} 8}\implies M=7$$