Condoms are rigorously tested to ensure that they are effective in preventing STDs and pregnancy when used for intercourse.
Gloves aren't, because they're simply not designed to be used to cover a penis during intercourse, let alone anal intercourse (which can create a greater risk of condom breakage).
In future, if you haven't got the right safer sex equipment on hand, then wait until you do before having sex. "Improvising" in this way can put you at serious risk.
Since there's no way of knowing how much (if any) protection the glove provided, you also have to proceed on the basis that you've had unprotected anal intercourse, which is one of the highest-risk activities around when it comes to STD transmission (and which can also create a risk of pregnancy if semen leaks onto the vulva).
So both you and your partner need to find out about getting screened for STDs, and you should take a pregnancy test (which you can do when it's been 10-14 days since the sex in question, or after the first missed day of your period, whichever is sooner).