In this paper, we consider a downlink communication and sensing system where cooperative non-orthogonal multiple access (C-NOMA) is adopted as a multiple access technique to jointly provide communication functionality to a set of users and sensing functionality to targets. Specifically, we leverage the potential gains of cooperative links between far and near NOMA users in terms of reducing the power allocated from the base station (BS) to far NOMA users to dedicate more resources to the sensing function. In doing so, we formulate this framework as an optimization problem to maximize the achievable sum rate of the communication users by jointly optimizing the users' pairing scheme, transmit beamforming at the BS, and near users' transmit power while respecting the required communication and sensing quality of service (QoS) constraints. Owing to the non-convexity of the formulated problem, we divide this problem into two sub-problems, namely the user paring sub-problem and the power allocation sub-problem. To solve the first sub-problem, we present a novel pairing approach that exploits channel orthogonality and correlation among different users. Then, we define a double-layer penalty-based algorithm to handle the non-convex structure of the second sub-problem. Finally, the numerical results clearly showed the effectiveness of our adopted C-NOMA system over traditional baseline schemes, where our proposed scheme achieves gains reaching up to 20% compared to traditional NOMA, and 40% compared to spatial division multiple access (SDMA). Moreover, our pairing strategy achieved performance reaching 95% that of the optimal pairing scheme.