The targa braces are at least 8 inches above the carpet if I remember, might even be higher. And remember the targa slopes up slightly in the middle.
Decide on what shape you want the box. You could make it just a basic cylinder that sits in the spare tire well. Grab a tape measure, measure how wide the circle is where the spare sits, and how high from the bottom of the spare well(directly in the middle since it's the highest point) to the targa(with the targa locked in its mounts.
This should give you a Diameter of something like 20", and a height of around 18"-22"? Now that's not that big of a box, a smaller sub would probably get the job done easier, and better. My measurements are a total guess though, I haven't looked in my hatch in months. You really gotta go out and get some measurements, and find out what the suggested enclosed box size for that sub is. Good luck.