sed is a Unix utility that makes it easy to perform text replacement operations like changing all instances of "NA" to "5". http://www.grymoire.com/Unix/Sed.html is a decent tutorial; the most important part is "The essential command: s for substitution".
http://www.mingw.org/wiki/msys provides one way to install sed and a Unix-style command prompt on Windows. Once it is installed, you can run the following:
plink --ped tsnpsMatrix.ped --map tsnpsMatrix.map --no-parents --no-sex --no-pheno --no-fid --geno 0.1 --maf 0.05 --recode A --out tsnpsMatrix
cat tsnpsMatrix.raw | sed s/NA/5/g > tsnpsMatrix.raw5
tsnpsMatrix.raw5 will then contain the '5's you want.
One warning: if any of your SNP IDs, FIDs, or IIDs contain 'NA' in the middle, you will need to do a bit more work.