This is a passage from my English exercise book:
After spending a day at the beach, I stopped to buy a snack on my way home. But when I searched for my wallet, it wasn’t there. I checked my other pockets, and the car and then headed back to look at the beach. My driver’s license, my ID card – my mind was racing through all the things I had lost and I felt rotten. A search of the beach and parking lot proved fruitless, so I headed home. I tried to forget it because there was nothing I could do, but I was mad at myself for losing it. After dinner when I was watching TV and trying to forget, the phone rang and a voice asked: “Did you lose a wallet? I found it on the beach.” What a great feeling that gave me – not only for my luck, but also for my faith in all humanity!
I guess the meaning of the phrase "what a great feeling that gave me" is "what a great feeling that / which I had". I don't really understand the meaning of the word 'gave' in the sentence. A great feeling gave me what (What did a great feeling give me)? It seems like the word 'gave' might have a special meaning when it goes with 'feeling'. Could you please explain this special meaning in this context?