Yes, why wouldn't you? Your friend is still the same person they were even if you are gay. If she/he wouldn't have told you then you would have never known and still thought the same about that...