You can use Chinese Remainder Theorem.
The problem translates to: {1000≤N≤9999N≡5(mod9)N≡3(mod7)N≡3(mod5)
Now, we let N=9k+5 for some integer k. Since N≡3(mod7),
9k+5≡3(mod7)2k≡−2(mod7)k≡6(mod7)
Then we let k=7n+6 for some integer n. Then N=9(7n+6)+5=63n+59.
Repeat this process one more time with N = 3 (mod 5), and you will get N=315m+248 for some integer m.
We can try m = 0, 1, 2, 3, ... to see which one gives the smallest possible 4-digit number. You will get N=315(3)+248=1193. You are more than welcome to check that this solution satisfies the conditions described in the problem.