Suppose cost price is Rs. 100, then since he wants 5% profit, he should sell it at Rs. 105, but Rs. 105 is after applying 12.5% discount.
So after giving discount on some Rs. $x$, he should have Rs. 105. i.e.
$x - \frac{12.5x}{100} = 105 \implies x = 120$
So he should mark the goods at Rs. 120 i.e. 20% more than cost price.