Find the indices of values in one list in another
V, 26 bytes

jòdf kÄ/&#18;-
DÓÓ
Ò&#1;C1&#27;@"Gòdk


Try it online!

This is a very strange and hacky solution, because V has little to no concept of numbers. Input comes in this format:

6 8 4 1 2 5 3 100 
5 3 4 1 


With a trailing space on each line.

Hexdump:

00000000: 6af2 6466 206b c42f 122d 0a44 d3d3 0ad2  j.df k./.-.D....
00000010: 0143 311b 4022 47f2 646b                 .C1.@"G.dk


Explanation:

j                   " Move down one line (to N) (1)
 ò                  " Recursively:
  df                "   (d)elete until you (f)ind a space. This will be saved into
                    "   register '-' (2)
     k              "   Move up one line (to M)
      Ä             "   Duplicate line M (3)
       /&lt;C-r&gt;-      "   Move the cursor forward until the next occurence of register '-' 
                    "   (the number we deleted from N)
                    "   (4)
D                   "   Delete every character *after* the cursor (5)
 ÓÓ                 "   Remove everything on this line except for whitespace
Ò&lt;C-a&gt;              "   Replace every character on this line with `&lt;C-a&gt;`, which is the 
                    "   command for incrementing a number (6)
      C             "   Delete this line into register '"', and enter insert mode
       1&lt;esc&gt;       "   Enter a '1' and return to normal mode
             @"     "   Run register '"' as V code (7)
               G    "   Go to the last line (1)
                ò   " End recursion
                 dk " Delete the last two lines (m and n)


If this doesn't make it clearer, here are examples of the buffer during the various stages the loop goes through:

Stage 1 (| is the cursor)

6 8 4 1 2 5 3 100
|5 3 4 1


Stage 2:

6 8 4 1 2 5 3 100
|3 4 1


Stage 3:

|6 8 4 1 2 5 3 100
6 8 4 1 2 5 3 100
3 4 1


Stage 4:

6 8 4 1 2 |5 3 100
6 8 4 1 2 5 3 100
3 4 1


Stage 5:

6 8 4 1 2 |
6 8 4 1 2 5 3 100
3 4 1


Stage 6:

|&lt;C-a&gt;&lt;C-a&gt;&lt;C-a&gt;&lt;C-a&gt;&lt;C-a&gt;
6 8 4 1 2 5 3 100
3 4 1


Stage 7:

|6
6 8 4 1 2 5 3 100
3 4 1


Back to stage 1:

6
6 8 4 1 2 5 3 100
|3 4 1