When I am inspired to write a story from reading someone else's, I usually get in contact with them to let them know how much I love their story and how it has inspired me to write my own fiction. I'll let them know which scene it was that inspired it and inform them that I might use the same aspect in my own writing.
Then, when I post up my own, I will, in the disclaimer or author's note, mention that the story was inspired by [insert author's name] 's story titled [insert title of story].
In my opinion, as long as you don't take too much from someone else's story to incorporate it into your own, then there shouldn't be any issues.
I hope that helped!