Is it a Shimano groupset? If so, the sound could be caused by friction between the cassette surface and freewheel hub surface. It's very common with 11 speed cassettes. So much so that Shimano tried to remedy the problem by adding a plastic sticker to the back surface interface of 12 speed cassettes. That sticker can sometimes peel off partially or fully and create problems. You could try taking the cassette off and applying grease to the innermost surface that faces the freehub and the surfaces between each cog group.