I love both studios deeply, but I feel like this is an easy win for Rare. It was very, very good during the ZX Spectrum and NES days and it was arguably the best developer in the world from 1994-2000. It turned out a great game every single year during that time — sometimes more than one great game a year. And there was so much diversity in terms of genre: racing, fighting, platforming, shooting, whatever the heck Blast Corps is. Even if we only look at the best game from each developer, I'd argue Rare, at worst, ties. For me, Banjo-Kazooie is equal in quality to Metroid Prime.
I will say it remains incredibly impressive to me that Nintendo gracefully moved away from Rare as the wheels were coming off and transitioned to Retro, which immediately put out a masterpiece. You went from Perfect Dark and Banjo-Tooie in 2000 to Metroid Prime in 2002. And you didn't have to spend $375 million for the privilege.