An edge labeling of a graph distinguishes neighbors by sets (multisets, resp.), if for any two adjacent vertices u and v the sets (multisets, resp.) of labels appearing on edges incident to u and v are different. In an analogous way we define total labelings distinguishing neighbors by sets or multisets: for each vertex, we consider labels on incident edges and the label of the vertex itself.In this paper we show that these problems, and also other problems of similar flavor, admit an elegant and natural generalization as a hypergraph coloring problem. An ieds-coloring (iedmcoloring, resp.) of a hypergraph is a vertex coloring, in which the sets (multisets, resp.) of colors, that appear on every pair of intersecting edges are different. We show upper bounds on the size of lists, which guarantee the existence of an ieds-or iedm-coloring, respecting these lists. The proof is essentially a randomized algorithm, whose expected time complexity is polynomial. As corollaries, we derive new results concerning the list variants of graph labeling problems, distinguishing neighbors by sets or multisets. We also show that our method is robust and can be easily extended for different, related problems.We also investigate a close connection between edge labelings of bipartite graphs, distinguishing neighbors by sets, and the so-called property B of hypergraphs. We discuss computational aspects of the problem and present some classes of bipartite graphs, which admit such a labeling using two labels.