Let $n$ be a positive integer such that $\lfloor\sqrt n\rfloor-2$ divides $n-4$ and $\lfloor\sqrt n\rfloor+2$ divides $n+4$. Find the greatest such $n$ less than $1000$. (Note: $\lfloor x\rfloor$ refers to the greatest integer less than or equal to $x$.)

Let's think step by step and output the final answer within \boxed{}.
user