You have to be an active member to get the $5 credit back for each gift card purchased, but it can be during your trial month. Dealpass programs (HWSC is a dealpass program) usually credit back on the first business day of the following month. So if you ordered gift cards and were charged for them before the end of April, your credit card would typically get credited back on May 3rd.
But if you signed up on April 1st or 2nd, ordered cards, your trial month would be over by the time you see your credit back. If you signed up anytime after April 4th, you could cancel on May 4th (or 5th depending on how fast your credit card shows you transactions), and you still would have been in your trial month.
So you don't have to be a paying member to get your credit back, it just depends on when you signed up and ordered your gift cards.