Correlated sub selects with COUNT condition from another table

I am having problem with figuring out a mysql querry. The pseudo code would be like this:
table 1 is users table
table 2 is a posts table, and I need to select only those users, who had minimum 5 posts within the time of 1000-2000 seconds of activity.

SELECT * FROM table1 WHERE **( COUNT(id) FROM table2 WHERE `user`=user_id.table1 AND `time`> 1000 AND `time`< 2000 ) > 5** AND active.table1 = 1 LIMIT 0,10

Thank you for help in advance.