Since you are blocking the request at the IIS level, Sitecore is never seeing it. You just need to add the proper 404 config in your web.config. Then IIS will handle it properly.
<configuration>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Auto">
<remove statusCode="403" />
<remove statusCode="404" />
<remove statusCode="500" />
<error statusCode="500" responseMode="File" path="/500.html" />
<error statusCode="403" responseMode="Redirect" path="/404.html" />
<error statusCode="404" responseMode="Redirect" path="/404.html" />
</httpErrors>
</system.webServer>
<system.web>
<customErrors mode="On" defaultRedirect="500.html" redirectMode="ResponseRewrite">
<error statusCode="403" redirect="/404.html" />
<error statusCode="404" redirect="/404.html" />
<error statusCode="500" redirect="/500.html" />
</customErrors>
</system.web>
</configuration>
And you will need to make sure you IP denial is set to "Non Found" via "Edit Feature Settings" when you click on your IP rule.