To release a song containing a sample you must be granted permission from rights holders that own the music composition as well as the rights holders that own the sound recording. For example, to sample a lyric or piece of instrumentation, you would need the sample cleared by both the owners of the lyrics and the underlying composition (usually the music publishers) and the owners of the recording (usually the record label).
If you use a piece of someone else's composition (e.g. a lyric, chord, guitar riff etc.) to include in your song, but rather than using that piece of the original recording you re-record the lyric or chord, guitar riff etc, then you have used an interpolation rather than a sample. While you would not need the permission of the owner of the original sound redording (because you didn't use the recording), you would still need the permission from the owner of the original composition. A mechanical license will not cover this use, instead you will need to negotiate directly with the owners/rights holders.