Sure. Regardless of the directory-depth, if there is no filetype in the requested URI and the URI does not resolve to an existing directory-index file, then internally rewrite to an known-non-existent file to force a 404:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/)*([^./]+)?$ /filepath-which-does-not-exist [L]
Since you did not specify, this code is for use in .htaccess or within a <Directory> container in a config file on Apace 1.x, and assumes that you've already got other working mod_rewrite code in the context in which you intend to use it.
For use in a config file outside of any <Directory> container, add a slash to the beginning of the RewriteRule's pattern after the start-anchor.
For use on Apache 2.x, you may change the rewriterule to
RewriteRule ^([^/]+/)*([^./]+)?$ - [R=404,L]
if you prefer. Retain the RewriteCond as-is.
The check for "no filetype" (i.e. no period in final URL-path-part) improves efficiency, because it avoids the resource-intensive filesystem check for the majority of requests (such as those for images, css and external js files, etc.). The rewritecond won't be processed at all unless the RewriteRule pattern matches.
Note that because of this exclusion, if an index file is explicitly requested this rule won't execute, and that case will be handled by the server's default 404 handling if the requested index file does not exist.
Jim