Use two sheets of thin, good quality, clear glass. At least one sheet can be anti-newton glass if you can get it. Anti-newton is not strictly necessary but helpful.
Use two pieces of thin, opaque material like construction paper. Cut them into two "L" shapes, like corners of a picture frame. Position them to mask off the negative. Use tape to carefully tape everything down, if necessary.
Make a "glass sandwich" with your film and carefully trap it in the gate of your enlarger.
Don't let your enlarger slam shut or else... "CRACK!"
I have two sheets of clear glass, 6" x 6", which I bought just for the purpose.
The sprocket holes and outside edges of the aperture where there is no film shouldn't cause trouble unless you have too much light spillage. That's what the masking is for.
Carefully done, those areas will just come out "dead black" like the way a contact sheet looks.