Someone might follow up with a more elegant solution, but you could change the web.config to use default ASP.Net behavior:
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="http://www.yourdomain.com/SiteMap/tabid/123/Default.aspx"/>
</customErrors>
Or you can also use the built-in Request Filter feature found in the Host Settings page. However, both options are DNN instance-wide. Meaning, they will redirect to the same page, regardless to which portal experienced the 404 status.
That being said, the last option I have to suggest is to write a HTTP Module to capture the 404, determine the portal, and then redirect to the appropriate error page. Better yet, customize the default DNN UrlRewrite Module to predetermine if the request will be 404'd per your business requirements. The DNN Exception HttpModule could do it too, but I'd suggest leaving that one alone.
You probably can already tell, that the first option is the easiest to implement.