Specifically, for N fixation you would target the nifH gene, for denitrification you would target nirS, nirk (both nitrite reduction) and nosZ (terminal nitrous oxide reduction) for functional gene amplicon sequencing. NCBI blast is a poor choice for determining the nearest match; annotation is poor (not curated) and nucleotide-based methods do not reflect biological function as much as amino acid sequences. I would sequence then translate to protein (using a curated database such as RDP (fungene.cme.msu.edu) and BLASTp to the fungene database or use the FRAMEBOT nearest match (though it is based on a much truncated database).