This would probably be legally considered "gambling' Gam,bling is prohibited in many US states and a good many non-US jurisdictions. It is significantly regulated in most US jurisdictions where it is legal, often requiring a specific license.
Analyzing laws on this subject in all 50 US states would be beyond the scope of an answer here. This is definitional the sort of thing where consulting a local lawyer, experienced in this area of law, would be wise.
As an example I will cite the specific laws which I think woulds apply to the situation described n the question in teh US state oof Maryland.
The Maryland criminal code Section 12-201 provides that:
In this subtitle, "lottery device" means a policy, certificate, or other thing by which a person promises or guarantees that a number, character, ticket, or certificate will, when an event or contingency occurs, entitle the purchaser or holder to receive money, property, or evidence of debt.
Thus an entry or ticket issues by such an app, would be "lottery device" if winners were paid in money or things exchangeable for money or property, which would include gift cards.
Section 12-203 provides that:
(a) Prohibited.- A person may not:
(a) (1) hold a lottery in this State; or
(a) (2) sell a lottery device in the State for a lottery drawn in this State or elsewhere.
Section 12-205 provides that:
(b) Prohibited.- A person may not:
(b)(1) bring a lottery device into the State; or
(b)(2) possess a book, list, slip, or record of:
(b)(2)(i) the numbers drawn in a lottery in this State or another state or country;
(b)(2)(ii) a lottery device; or
(b)(2)(iii) money received or to be received from the sale of a lottery device.
Section 12-206 provides that:
b) Prohibited.- A person may not print, write, or publish an account of a lottery that describes:
(b)(1) when or where the lottery is to be drawn;
(b)(2) any prize available in the lottery;
(b)(3) the price of a lottery ticket or share of a lottery ticket; or
(b)(4) where a lottery ticket may be obtained.
Most plausible ways to advertise an app as described in the question would seem to violate this section.
Section 12-208 provides that:
A court shall interpret §§ 12-201 through 12-207 of this subtitle liberally to treat as a lottery ticket any ticket, part of a ticket, or lottery device by which money is paid or another item is delivered when, in the nature of a lottery, an event or contingency occurs.
So if it is arguably a lottery, the court will treat it as one.
Section 12-209 provides that:
A grant, bargain, or transfer of real estate, goods, a right of action, or personal property is void if it occurs while engaging in, or aiding or assisting in a lottery.
So winners cannot lawfully collect prizes.
In short any such app would seem to viol;ate several sections of Maryland law if it is used of promoted in Maryland