This is a male (no ovipositor)
Megarhyssa species, most likely M. atrata. Compare with what is described as male M. atrata at
Guide to Insects of Quebec. Given this close match to a photograph and its association with an undoubted female M. atrata, I'm going to make the reasonable judgment that this is a male M. atrata. Update. Seems to agree with this photo identified as male M atrata by Bob Carlson: "Coloration of forewing and hind femur are indicative of atrata"
This male Megarhyssa was closely associated with the female M. atrata below: