We first consider the relation:
$$n\delta{\lambda} = d\delta{\theta}\cos{\theta}$$
It's content is that the $n^{th}$ order maximum of a wavelength $\lambda + \delta{\lambda}$ is displaced from the corresponding maximum for a wavelength $\lambda$ by the angle $\delta{\theta}$, related to $\delta{\lambda}$ by the above equation.
Now, we can ask the question, "for what (minimum) value of $\delta{\lambda}$ can we clearly distinguish between the $n^{th}$ order maxima of $\lambda$ and $\lambda + \delta{\lambda}$?" The answer is that we can certainly do this (using the Rayleigh criterion) when the angular width $\delta{\phi}$ of the $n^{th}$ order maximum of light of wavelength $\lambda$, on either side of the maximum, is less than the separation of the maxima, $\delta{\theta}$ i.e. when
$$\delta{\phi} \le \delta{\theta}$$
or, the minimum value of $\delta{\lambda}$ that can be just resolved is one for which
$$\delta{\phi} = \delta{\theta}$$
Now, what about the spread $\delta{\phi}$ of the $n^{th}$ order maxmimum? When considering the grating as a series of a large number of slits $N \gg 1$ with separation $d\cos{\theta}$, you can see that a minimum occurs at an angle for which the contribution from a slit of position $m \le \frac{N}{2}$ is out of phase with that of position $m + \frac{N}{2}$, so that each of these pairs have a net zero contribution (note that we can always consider $N$ to be even, when it is large, by neglecting the contribution from one slit if necessary). Therefore, with the diffraction grating width of $W = Nd$, we see that the required criterion is that slits at a separation of $\frac{W\cos{\theta}}{2}$ are out of phase i.e. that (for the first minima from the centre)
$$\frac{2\pi}{\lambda} \frac{W\cos{\theta}}{2} \delta{\phi} = \pi$$
$$\delta{\phi} = \frac{\lambda}{W\cos{\theta}}$$
Note that a similar argument can be used for diffraction from a single, continuous wide slit (which is comparable to this case as both deal with a large number of point sources).
Thus, we now have, on equating $\delta{\phi}$ and $\delta{\theta}$,
$$\delta{\lambda} = \frac{\lambda d}{nW} = \frac{\lambda}{nN} \implies \frac{\lambda}{\delta{\lambda}} = nN$$
This result is independent of your methods of observation (aperture or otherwise) so long as you take care to observe all parallel rays inclined at an angle $\theta$, focused at a point.
Best Answer
This question is very much related to Help understanding resolution between two light beams which perhaps should be read first?
The first thing to remember is that in general the number of slits in a diffraction grating $N$ is very large so $N\gg 1$.
In the diagram below there are $N+1 \approx N$ slits of which only a few are shown.
For the $m^{\rm th}$ order the basic diffraction grating equation is $m\lambda = d \sin \theta_{\rm m}$ where $d$ is the distance between adjacent slits and the path difference between adjacent slits is $m\lambda$.
In my diagram the path difference between the slit labelled $A$ and that labelled $I$ is $Nm\lambda = IJ$ where $N$ is the number of slits in the grating.
The light from all slits in the grating constructively interfere and this results in a principal maximum in direction $\theta_{\rm m}$.
Now consider a change of direction by $\Delta \theta_{\rm m}$ such that the path difference between the light from slit $A$ and slit $I$ is $Nm\lambda + \lambda$. This would result in the slits in the bottom half of the grating and the corresponding slits in the top half of the grating, eg slit $E$ and slit $I$, producing waves which are half a wavelength out of phase and so interfere destructively.
This results in the first subsidiary minimum. The path difference between slit $A$ and slit $I$ could also be could also have been $Nm\lambda - \lambda$ and that would produce the first subsidiary minimum on the other side of the principal maximum.
From the diagram $AJ = D \cos \theta_{\rm m} = Nd \cos \theta_{\rm m}$.
For the triangle with angle $\Delta \theta_{\rm m}$ you have $\lambda = Nd \cos \theta_{\rm m} \:\Delta \theta_{\rm m}$ which then gives the result
$$\cos \theta_{\rm m} \:\Delta \theta_{\rm m} = \Delta (\sin \theta_{\rm m}) = \frac{\lambda}{Nd}$$
Note that this relationship gives the angular half width of a principal maximum.