c. 1966-1969 [and later; this expression appears in several Star Trek shows and films], Dr. McCoy in Star Trek to the erstwhile Captain Kirk: “Dammit Jim, I’m a doctor, not a(n) {engineer, mechanic, bricklayer}!” This one is somewhat unique in that it started out as a snowclone, where Bones altered the Y as it fit the situation. I think the exclamation point is obligatory, to further separate X from Y: not only is McCoy not a bricklayer, it is absurd to consider him one. The exclamation point–or intonation mimicking the original, when spoken–is also necessary to evoke the original usage, rather than a simple comparison of two unlike things. X and Y should be semantically distinct from each other, but sometimes the difference between them is subtle for the sake of humor.
Other variations seen on the web:
“I’m an ingenieur, NOT a bloody locomotive driver!”
“I’m an architect, not a project manager!”
“I’m an accountant not a magician!“