We study the discrete memoryless Z-interference channel (ZIC) where the transmitter of the pair that suffers from interference is cognitive. We first provide an upper bound on the capacity of this channel. We then show that, when the channel of the transmitter-receiver pair that does not experience interference is deterministic, our proposed upper bound matches the known lower bound provided by Cao and Chen in 2008. The obtained results imply that, unlike in the Gaussian cognitive ZIC, in the considered channel superposition encoding at the non-cognitive transmitter as well as Gel'fand-Pinsker encoding at the cognitive transmitter are needed in order to minimize the impact of interference. As a byproduct of the obtained capacity region, we obtain the capacity under the generalized Gel'fand-Pinsker conditions where a transmitter-receiver pair communicates in the presence of interference noncausally known at the encoder.