For the diffraction grating (not youngs slits) you ahve an equation
nλ = d sin theta
The n has to be the same for both, d is the diffraction grating spacing and you have two wavelengths.
At the moment I can't see any other way to do it that start from n=1 (n=0 will give angle zero for both) and solve for theta until you find 5º of difference for the two wavelengths. (ie, start with n=1 and if the difference isn't enough, try n=2 and so on)
Someone else more inspired might come up with a shortcut.