We consider network coded cooperation for cognitive relay networks. The primary system comprises multiple sources and multiple destinations, whereas the secondary system comprises multiple sources, multiple relays and a single destination. We derive a closed form expression for the end-to-end outage probability for the secondary system while assuming the presence of interference constraints between the two sub-systems. Based on the diversity order analysis, we propose a framework for adaptive network coding. The proposed scheme involves using a small encoding set size for low link quality and a large encoding set for good link quality. Having a small set size increases the probability of having relay cooperation, which comes at the expense of some loss in coding gain, whereas using a large encoding set size decreases the probability of having relay cooperation, but achieves some network coding gains. Therefore, there is a fundamental trade-off between the probability of relay cooperation and the achievable network coding gains. Using numerical results, we show that the proposed adaptive network coding achieves up to 5 dB gain at target outage 10-3 as compared to conventional fixed network coding schemes.