I'm assuming you mean 6 speed as there is (to the best of my knowledge anyway) no such thing as a 12 speed cassette.
The problem is that a 6 speed cogset is actually a freewheel mechanism with six cogs attached to it that screws onto a threaded hub whereas 8 speed and up cassettes generally slide onto a freehub body.
The only way it'll work is if the wheel you buy is of the old design which accepts screw on freewheels and without knowing what wheels you're looking at no one can guess if it will work.