Short answer is YES you can restrict the usage of an app specific to a Zendesk Role or Group..
Licensing works on a per agent basis. You can control the agents that have access to an app by restricting the app to a specified group (or groups) and/or a specified role (or roles).
This is done in the app settings which is accessed via Admin (cog icon) > Admin Centre > Apps and Integrations
Click on the icon of the app you wish to change the settings of.
At the bottom of the settings you can then configure the role(s) and/or group(s):
Your existing roles or groups may not contain the subset of agents that you require, in which you'll need to create a new group, add the required agents to it, and assign the group to the app restrictions.
You will only pay for the number of agents that have access to the app.