The assumption that data samples are independent and identically distributed (iid) is standard in many areas of statistics and machine learning. Nevertheless, in some settings, such as social networks, infectious disease modeling, and reasoning with spatial and temporal data, this assumption is false. An extensive literature exists on making causal inferences under the iid assumption, but, as pointed out in the literature, causal inference in non-iid contexts is challenging due to the combination of unobserved confounding bias and data dependence. In this paper we develop a general theory describing when causal inferences are possible in scenarios where both occur. We show that, under certain conditions, it is possible to identify counterfactual distributions in causal models which allow both dependence, and unobserved confounding. We use segregated graphs, a generalization of latent projection mixed graphs, to represent causal models of this type and provide a complete algorithm for non-parametric identification in these models. We then demonstrate how statistical inferences may be performed on causal parameters identified by our algorithm.