The set bits of a subnet mask indicate the network bits and the unset bits indicate the host bits for an IP address in that network.
Here the subnet mask = $\textbf{1111 1111.1111 1111}.000\textbf{1 1111}.0000 0000$.
The first two octect and the last 5 bits of the 3rd octet give us the network bits of any IP address in that particular network.
For two IP addresses belonging to the same network these specific bits should match.
So in the options the first 2 octet and the last 5 bits of the 3rd octet of both the IP addresses should match.
In options $A.$ and $C.$, the addresses clearly have different 2nd octet.
In option $B.$, the first IP address has an even 3rd octet and the second IP address has an odd 3rd octet, so they differ in the last bit of the 3rd octet. Hence they are from different networks.
In option $D.$, the first two octet match.
$129 = (100\textbf{0 0001})_2$ and $161 = (101\textbf{0 0001})_2$, so the last 5 bits of their 3rd octet also match. Hence they belong to the same network.
$\therefore$ $D.$ is the answer