Let's jump into an example to answer this question.
Question: “A person unrelated to me (my boyfriend) would like to give me some money so I can have a medical procedure. I’m covered under a high-deductible healthcare plan (HDHP). I also have a health savings account (HSA). If my boyfriend contributes to my HSA, will he be eligible for tax benefits of the contribution?”
Answer: The short answer is no, he won't get the tax break. In fact, the only two people who will get a tax break when contributing to your HSA are you and your employer. The Internal Revenue Service, or IRS, allows the HSA account holder to claim only her own contributions. So it does not matter if the person is related to you or not. If someone else funds your HSA, no one gets to claim the money against his or her taxes.
Here’s an alternative solution.
You could ask your boyfriend—mom, dad, whomever—to write you a check and then make a contribution to your HSA yourself. As long as you don’t exceed your maximum annual contribution (the limit for individuals is $3,550 in 2020), then your contribution will be tax-deductible.