Use idea of a paper to prove new result
Since it's your first paper, you can in general assume that your supervisor knows better than you if it is worthwhile publishing. There are many publications out there - in math and other fields - that takes an idea or formalism from one paper, and applies it to a slightly different area. This is how progress in research works.

And yes, you should definitely cite the other paper. The fact that you've been inspired by something else does not disqualify your paper. In fact, quite the opposite can be the case, if it is not obvious that the idea from the other paper can be applied to a new area.