We study a number of two-user interference networks with multiple-antenna transmitters/receivers (MIMO), transmitter side information in the form of linear combinations (over an appropriate finite-field) of the information messages, and two-hop relaying. We start with a cognitive interference channel (CIC) where one of the transmitters (noncognitive) has knowledge of a rank-1 linear combination of the two information messages, while the other transmitter (cognitive) has access to a rank-2 linear combination of the same messages. This is referred to as the network-coded CIC, since such linear combination may be the consequence of some random linear network coding scheme implemented in the backbone wired network. For such channel we develop an achievable region based on a few novel concepts: precoded compute-and-forward (PCoF) with channel integer alignment (CIA), combined with standard dirty-paper coding. We also develop a capacity region outer bound and find the symmetric generalized degrees of freedom (GDoF) region of the network-coded CIC. Through the GDoF characterization, we show that knowing mixed data (linear combinations of the information messages) provides a unbounded spectral efficiency gain over the classical CIC counterpart, if the ratio (in decibel) of signal-to-noise (SNR) to interference-to-noise is larger than certain threshold. Then, we consider a Gaussian relay network having the two-user MIMO IC as the main building block. We use PCoF with CIA to convert the MIMO IC into a deterministic finite-field IC. Then, we use a linear precoding scheme over the finite-field to eliminate interference in the finite-field domain. Using this unified approach, we derive the symmetric sum rate of the two-user MIMO IC with coordination, cognition, and two-hops. We also provide finite-SNR results (not just DoF) which show that the proposed coding schemes are competitive against state-of-the-art interference avoidance scheme based on orthogonal access, for standard randomly generated Rayleigh fading channels.