To be able to access your internal only function, the requests need to come from a VPC network in the same project. App Engine Flex and Standard connect differently to VPC networks:
For App Engine flex you just need to set the network settings in the app.yaml file.
On the other hand, standard needs to use Serverless VPC Access [1]. For this, you need to create a Serverless VPC Access connector and then configure App Engine to use it to connect to the VPC network.
[1]: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access