Generalized frequency division multiplexing (GFDM) is suitable for cognitive radio networks due to its low out‐of‐band emission and high spectral efficiency. In this paper, we thus consider the use of GFDM to allow an unlicensed secondary user (SU) to access a spectrum hole. However, in extremely congested spectrum scenarios, both active incumbent primary users on the left and right channels of the spectrum hole will experience out‐of‐band interference. While constraining this interference, we thus investigate the problem of power allocation to the SU transmitter to maximize the overall data rate where the SU receiver is employing a matched filter or zero‐forcing receiver. The power allocation problem is thus solved as a classic convex optimization problem. Finally, total transmission rate of GFDM is compared with that of orthogonal frequency division multiplexing. For instance, when right and left interference should be below 10 dBm, the capacity gain of GFDM over OFDM is 400%.