This seems like a great opportunity, actually. If you can go visit him in the office just ask if the gift card offer is still open. He will probably slap his forehead for forgetting about it. Keep it low key. But it is a good thing to make a connection like this. Even bumping in to him in the hall would be a way to raise it.
If you can't visit in person, an email would be fine. Just remind him of the question you answered and ask if he forgot about the gift card or whether some issue came up. Just be direct. You don't need to be bashful about such things.
Edited to add: It would also be good, no matter how you do it, to thank the professor for the problem you solved and for the offer of the gift card. The reason for thanking him for the problem is that it, I hope, increased your learning.