If you are completey a conscious law abiding individual of course there is some element that could be construed as illegal, even giving it away possibly since you are in essence using someone elses work to somewhat promote yourself in a way......
on the other hand there is no stopping sampling at this point, I think that everyone that has a means to make a beat samples and that number of people are much greater than back when Biz Markie, De La and the Beastie Boys were being sued....
so you have a trick question...... is it illegal? I would say yes even though I am not a lawyer all it takes to answer a question like this is plain old common sense....should you do it anyway sure go ahead but look at the headlines everynow and then where cats are busted for mixtapes...but of course they sell them but they have known instrumentals with other rappers than the original but nonetheless those instrumentals are copywritten and belong to someone else......
my thoughts.