As @poncho and @MaartenBodewes said in comments, there is no general solution to this, but there may be something available on your platform.
For example, on an Android device you can get help with this from the OS via the Android Keystore:
Use the Android Keystore provider to let an individual app store its own credentials that only the app itself can access. This provides a way for apps to manage credentials that are usable only by itself while providing the same security benefits that the KeyChain API provides for system-wide credentials.
Windows has something similar in the Data Protection API (DP-API) where the windows kernel helps you encrypt a secret (for example a key or password) either for LocalMachine (ie any process on the machine can decrypt it), or for CurrentUser. So if you're able to create a service account that is only used by your app, then it might do what you want.
In general, a client cert attests that the request came from the right device (assuming you had a secure way to set up and register the key in the first place), but does not attest which application within the device.