This may be a simple FIND. But we may need more information from you (the structure of your database, where you see the customers and the transactions, etc.)
Each database may be unique enough that a generic question will have no answers.
You may start here (then follow the links):
Most likely you have a table of customers and a related table of transactions (invoices, perhaps) with dates
If that's the case, you could simply find all customers who HAVE transacted in the last 5 months (find records with transaction date > 2016/12/13), then use "Show Omitted Only" to find the inverse.
This find would take place from the context of customers. If you're doing it manually, you'll need a portal to transactions that includes the related date field). If you're doing it by script, you can simply set the related field.
At this point you could loop through the records and send emails.
I've built-in a variety of assumptions to my suggestion so if you need more specific help than that, then as Beverly says, we need much more info!