You can do this with one command :
:1,.s/ " start a substitute command from top of the document to current line
<C-r><C-w> " paste the content of the word under the cursor
// " replace with noting
gn " don't actually replace
And in normal mode you can create a mapping for better use :
nnoremap <leader>n :1,.s/<C-r><C-w>//gn<CR>
:h c_<C-R>_<C-W> for further references.
If you want to rely on your previously entered search pattern, you can replace
<C-R>/. As the
/ register is the search register, it contains the last search pattern.