Purchasing a battery for a 12VDC, 5A device
To calculate the capacity you need, you just multiply the number of amps by the number of hours.  So 5A for 40 hours is 200Ah, simple as that. You should build in some safety margin, as the capacity will drop as the battery gets older.

Batteries which are not advertised as "deep cycle" or "deep discharge" will age faster as you use them, but if you're not using it often, it won't really matter too much.  The car batteries you've been looking at should really have a capacity marked on them somewhere (it's required by law over here, maybe not in the US), but they are probably in the 40-80Ah range.  300USD seems not unreasonable for a 200Ah version. Because the car batteries are mass produced, it may work out cheaper to get several car batteries and put them in parallel, a quick look at my usual suppliers suggests that could be done for £180 (about 240USD).

Whatever you do, check your equipment can run OK from a car battery.  The actual voltage of a car battery at 5A will drop a bit below 12V, and when charging from a car may go as high as 14.5V.