In your config file nsd.tcl (or whatever you've named it), the 404 file is set thus:
ns_section "ns/server/${server}"
# stuff excised
ns_param NotFoundResponse "/global/file-not-found.html"
and then you simply modify
/www/global/file-not-found.html
Note you can obviously use a tcl file there if you want to generate a non-static page. You need to have the ns_param file name match what's in the /www/global/ directory, of course.