N95 being a best seller was one of the reasons why Nokia was so sure that iPhone would fail. It lulled them into false security and proved to them that things were going great.
I happened to review the N95 and it felt horrible after seeing Jobs demoing the iPhone prototype. Couldn't believe for a second that the Nokia's way would work out with S60 series and was super surprised to hear N95 was selling really well.
Of course iPhone would gather steam for a couple of years before getting good enough but still.
In other words, it didn't sell more because it was actually viable competition. It sold more because of brand momentum and because it was on sale for longer.
N95 was worldwide.
Also while the N95 stuck around for a while, the N95 did sell more rapidly than the first iPhone. Assuming the dates Wikipedia uses are accurate the N95 reached 7 million units at the end of 2007 after being released in March of that year, and then 10 million by end of Q1 2008. The iPhone was released June 2007 and discontinued July 2008 and sold 6.1 million units. That being said availability of the first iPhone was limited outside the US and it was limited to Cingular, and the N95 wasn't sold via carriers in the US.
[1]https://www.cnet.com/tech/mobile/apple-iphone-vs-nokia-n95/
There was Nokia N96, N97, N8 (which was nice), N900, Nokia 5800... Let alone N9. There was also Nokia 808, which used basically the same camera sensor as Lumia 1020.
(will exclude here the Windows Phone devices of course...).