Selecting files with one extensions that have the same name as files with a different extension
Open terminal and use cd to make the directory of *.nef files your current directory. Let's assume you have this structure:

mydir/jpegdir
mydir/nefdir

So cd into mydir/nefdir

Then:

mkdir newdir
for file in *.nef; do 
    root=${$file%.nef}; 
    jpeg=${root}.jpg; 
    mv ../jpegdir/${jpeg} ./newdir/
done


example below. Note here that I put "echo" in front of the mv command. You want to omit that, but I often use it when I'm checking that a script is doing what I expect before executing it. You also don't say what you want to do with the files, but moving them to a new folder allows you to select them, and you can always move them all back. I also shortened my tmp variable names.

$ ls -R
total 0
drwxrwxr-x  4 tim  staff  136 Jun 13 08:02 .
drwx------  9 tim  staff  306 Jun 13 08:02 ..
drwxrwxr-x  8 tim  staff  272 Jun 13 08:03 jpegdir
drwxrwxr-x  5 tim  staff  170 Jun 13 08:03 nefdir

./jpegdir:
total 0
drwxrwxr-x  8 tim  staff  272 Jun 13 08:03 .
drwxrwxr-x  4 tim  staff  136 Jun 13 08:02 ..
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo1.jpeg
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo2.jpeg
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo3.jpeg
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo4.jpeg
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo5.jpeg
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo6.jpeg

./nefdir:
total 0
drwxrwxr-x  5 tim  staff  170 Jun 13 08:03 .
drwxrwxr-x  4 tim  staff  136 Jun 13 08:02 ..
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo2.nef
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo3.nef
-rw-rw-r--  1 tim  staff    0 Jun 13 08:03 foo5.nef

$ cd nefdir/
$ mkdir newdir/

$ for f in *.nef; do g=${f%.nef}; h=$g.jpeg; echo mv ../jpegdir/$h ./newdir; done
mv ../jpegdir/foo2.jpeg ./newdir
mv ../jpegdir/foo3.jpeg ./newdir
mv ../jpegdir/foo5.jpeg ./newdir