I am using $top 5000 in URL of ajax call. Then I am getting data but if I put filters its shows threshold limit error.
The clear cut answer to your question is
No, you cannot fetch more than 5000 record in one single REST Call
If you want to get data by filtering then also make sure that the filter should not return more than 5000 records.
Also the column you are using for filtering must have Indexing enabled.
For more detail on indexing the column you can look the answers here.
If you want to know more about indexing columns in detail then there is very fine answer here.
Or else you need to write some recursive calls to get the values which will result in multiple REST calls.