Her fellow forward Claire Emslie came close to doubling the lead a few minutes later when she rifled a shot goal-bound but Nayler produced a fine save.
The Ferns went into the sheds in Pinatar 1-0 down on the scoresheet but they had competed well for long periods. At half-time, Heraf made three changes with Anna Green coming on for CJ Bott, Elizabeth Anton for Katie Bowen, and Hannah Wilkinson took Annalie Longo's place.
Scotland picked up from where they left off before the break. Midfielder Erin Cuthbert crossed well for Lisa Evans who hit a good header, but it was just wide of the target.
The Ferns came back into the game and could have easily been back on level terms when substitute Green hit a powerful shot on the back of an Olivia Chance corner which hammered into the crossbar.
The white shirts continued to pour forward and Amber Hearn had a great chance to level the scores in the 74th minute. New Zealand's prolific striker, with 54 goals in A internationals to her name, hit a strong shot from inside the box but was denied by an impressive save from Scotland's keeper Lee Alexander. It was New Zealand's best period in the match.
Just as the Football Ferns got back into the match, and looked the more likely of the two teams to score, Scotland doubled their lead after 78 minutes. The Ferns defence turned the ball over and Scotland midfielder Cuthbert again teed up Lisa Evans to finish down the middle of the goal. It was the defining strike of the game.
Katie Rood came on in the final 10 minutes, in place of Sarah Gregorius in her first match back from international retirement, to earn her third international cap for New Zealand.
The Football Ferns will look to bounce back in the second international friendly against Scotland on Tuesday night (NZT) at the same venue.