First, please take this answer with a (big) grain of salt. I'm not a publishing or legal professional, so if you really want to know the right answer, you should ask someone who is. This answer is more just my two cents worth.
You have four scenarios where you possibly want to use InspirationWork (IW) in your own writing in some form. These are:
- Mentioning that the events of IW take place in the same universe as YourWork.
- Have a character in YourWork (YW) reference events from IW.
- Have a character in YW somehow in touch with character from IW, without mentioning name of IW character.
- Have a character in YW somehow related to a character of IW, without mentioning name of IW character.
Now, for the above situations, there are some questions I first want you to ask yourself which will greatly effect the answer of whether you can or cannot do this.
Is the InspirationWork in the public domain or otherwise NOT under copyright?
If the answer is yes, I believe you can do all of the above freely. All works and characters in the public domain are free to be used by writers other than the original author, whether for adaptations, sequels, spin-offs, etc.
But if the answer is no, then situations 1, 3, and 4 are a NO. Sure, you could mention them vaguely enough that if someone does sue you you can say 'But I was actually referencing this, not that!', but why risk it? You may as well create original interesting events to reference in your stories instead of making your writing a vague tie-in to already existing work.
As for situation 2 when it comes to non-public domain/still in copyright works, it's a bit of a grey area. If you mean mention IW as though it's part of the same universe as YW, then it's a no just like above. But, if you just mention it as a piece of fiction that is known in your universe, ('Hey, this reminds me of this thing that happened in a book I read ages ago!') then that can be OK. Sometimes. It depends on how clearly you reference it, whether you reference it in a good or bad light, the original author's temperment when it comes to their works being used/mentioned in other people's works, and I'm sure many other things. But like I said, I'm not a publishing or legal professional. But I would still be cautious.
Finally, though, if you have permission from the IW author, then there's no need to worry! You can do whatever they give you permission to do. But not more than that. If they give you permission to write a story with a character who's the cousin of their main character, but not permission to write a direct sequel, do not write a direct sequel. You would still have to be careful, though.