@Rohitravi
The Path Filter is applied against all subdirectories of the configured "Input Directory". Any files found in the base "Input Directory" are still going to be listed. If you had files in "dir4", they should not have been listed.
Is dir2 empty? If so can you change your "Input Directory" to /dir1/dir2 instead of /dir1/dir2/dir3.
I cannot think of a reason why when filtering based on subdir path that you would still expect to returns from the base directory, so I filed an Apache jira ( https://issues.apache.org/jira/browse/NIFI-7104 ).
Another option is to add a RouteOnAttribute processor after your listFile processor to route on only FlowFile where the absolute.path FlowFile attribute included "dir5".

Then auto-terminate the unmatched relationship and route the "dir5" relationship on to the next component in your dataflow.
Hope this helps,
Matt
If you found this solution resolves your query, please take a moment to click accept.