There are certain requirements you must meet to change your nameservers with Cloudflare
It is possible for Cloudflare domains to use Custom Nameservers configured for a different domain. However, those domains require an Enterprise plan and a request must be sent to Cloudflare Support detailing which Custom Nameservers to apply.
For more information on changing your Nameservers with Cloudflare please see this article on the CloudFlare support site.
You can also keep your DNS management with Cloudflare and simply configure your DNS entries to route traffic to StackPath without changing your Nameservers.