depends on baffle thickness and material the box is made from. those are the correct screw type (course thread construction wood screws) but the designation by the number next to the '#' carries two factors in most cases, being threads per inch and major diameter.
more material between threads lends to more 'bite', effectively reinforcing the overall strength of the screw's holding power. a screw with a smooth shank at the top is not ideal for maximum bite, it is more for keeping material from blowing out as it's displaced.
you can use finer thread screws for harder material and just the inverse.
using a fine thread screw on soft materials can and will strip the material away if you over-tighten/turn with a drill.
course thread screws used on hard material will be a pain in the butt to drive down as youre trying to cover more depth into the material at a faster rate, which will call for more torque.
it's a game of finding a happy medium depending on what youre using.
i do not recommend using drywall screws to hold drivers, ever... as they are very brittle and shear very easily with too much tensile force or torque applied. subwoofers nowadays are heavy and can cause alot of stress to screws. they are strictly made for holding drywall to wood and steel studs (course for wood, fine for steel) as the drywall has alot of give when driving the head flush, not only that.
to put it another way, 44 screws per 4x8 drywall sheet is standard on 16 inch studs. a half inch thick sheet of drywall is 51-52lbs, so each screw is holding 1.16 to 1.18lbs. quite a bit less than 12 on a standard basket with a 50lb motor attached to it.
length is also something to highly consider when choosing. it has always been my experience in the trade jobs ive had that ive applied to building enclosures, which is to never pick a screw longer than your depth as breaking through the rear of the material can be the start of losing said material if stress is applied by whatever it's holding together.
just a tip, but always pre-drill your holes to combat splitting and material blowout with a drill bit just a tad smaller in diameter than the minor diameter of the screw.