From a Google search:
Open the App Store app on your device. Find and select the app you want to gift. Tap the Share button beside the app's price, then tap Gift App from the iPhone Share Sheet. Personalize your gift, then confirm it.
Yes, it works. I tapped the Share icon to the right of an app's price button. Then a pop-up appears with the choices to Copy Link, or Gift App.
I didn't go any further than that since I didn't actually want to purchase or gift anything. But the option is there on my iPhone and iPad. From what I see, it can't be done from a Mac.
Major point though is it only works with an item that has a price. Free apps, or any app with a Get button with in-app purchases cannot be gifted.