As far as I know, there is no out of the box method in the CQWP where you can specify to fetch the items from only 2 lists.
However, you can specify a particular Content Type from which to fetch the items. So if you can specify a special Content Type for your 2 libraries, then it can be specified in the CQWP and only the items from these 2 libraries will be fetched.
Edit: As mentioned by @Nadeem, Another option would be to use the ListsOverride property of the CQWP in which you can specify the Guid of the lists to fetch the items from. Only caveat with this approach would be that you will not able to make any customizations from the UI after that. Have a look here: