We study the performance of a network-coded cooperative (NCC) system in an underlay cognitive radio network (CRN). The primary network (PN) consists of a single transmitter-receiver pair, and the secondary network (SN) is an NCC system with <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$N$ </tex-math></inline-formula> users, <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$M$ </tex-math></inline-formula> relays, and a single destination. The relays employ decode-and-forward (DF) protocol and use network coding (NC). We study the performance of the SN under two types of power constraints: i) the combined peak interference power constraint on the PN and maximum transmit power constraint at the SN; and ii) the single peak interference power constraint on the PN. For the SN, an exact closed-form expression and an asymptotically tight end-to-end outage probability are derived, and the diversity order and coding gain are quantified. Compared to the existing literature, the proposed CRN NCC has four main distinguishable features: i) it applies to general CRN NCC network settings with an arbitrary number of users and relays; ii) it considers general relay selection mechanism and independent and non-identically distributed (i.n.i.d.) <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$Nakagami-m$ </tex-math></inline-formula> fading channels; iii) it assumes secondary-to-primary and primary-to-secondary interference links; and iv) it provides a generalization of previous work and includes existing results in the literature as special cases.