The Legend of Zelda
If we're looking at Metroidvania titles and the influence they had on each other, we can easily see the parallels between Zelda II: The Adventure of Link and Castlevania II: Simon's Quest. Both a games played from a side-scrolling perspective with an open world (largely) free for the hero to explore, hidden secrets everywhere, and items that the hero is required to collect for further progression. Plus, both games have RPG leveling systems, further cementing the similarities between the games.
But while we can see the obvious connections between the second Zelda game and the burgeoning genre, we can't ignore the fact that the first title, despite taking a literal different perspective on the action, was just as formative on the games to come. While The Legend of Zelda isn't traditionally though of as a Metroidvania title, it just as clearly influenced the genre as the undisputed title holder, the original Metroid.
Nintendo of the era tended to silo their games. Once group within the company would create a title and then keep control of that IP, directing its evolution over the years. When you get an oddball title, like Zelda II, it's because the game was developed by a different group (in that game's case, Nintendo's Mario team), putting their own natural spin on the IP. But the different divisions clearly did talk and occasionally exchange ideas. There's no other way to explain how Nintendo of 1986 produced two very similar titles: The Legend of Zelda and Metroid. Sure, one is a top-down adventure and the other is a side-scrolling shooter, but when you look deeper you can see how the two share the same core idea.
In both games, the goal is to travel to the various regions of the map, collecting the items necessary to explore further (in the case of Zelda bow and arrows to defeat certain bosses, the ladder to reach new areas, and the raft to sail across the sea, along with other collectibles), all so that the hero can defeat select bosses to unlock the path to the final dungeon. Shift Metroid from a side view to top down and you have the same game, essentially.
Where each game shines is in the details. In the case of Metroid that was in the ambiance of the alien world and the sense that you were lost on this adventure along. For The Legend of Zelda, the world isn't as sparsely populated as all that. You will find plenty of NPCs along the way, all hiding in their caves to avoid the the monsters lurking outside, but this is a much less isolating game; you might be one person on their own adventure but you never feel quite as alone in this game. Hell, within the first few second you meet a kindly old guy that gives you a sword. Link, in short, needs the people around him in a way Samus never does.
Arguably the original The Legend of Zelda is a more linear game than the Metroidvania titles to come. Unless you know how to do the little glitches, the screen-wrap tricks and other minor ways to quickly get around (in short: unless you're a speed-runner) you'll likely be forced down the narrow path of going from dungeon one to two, three, then four in order. The world does eventually open up some, letting you take care of the final dungeons in a slightly more free form order, but the game does still feel very much on rails for huge portions which isn't quite the convention of the Metroidvania genre.
Not that it makes The Legend of Zelda a bad game to have any kind of rails; you do still have to find all the dungeons, and the various other secrets hidden around the world, and the game can be surprisingly obtuse. It's never unfair, though, and while its challenges may be tough the game is consistent in its rules. It's a game about experimenting, about exploring and discovery, a game tat prizes itself on giving you hours of entertainment as you tease every last morsel from the game. And then it dumps a second adventure on you saying, "go do it again, only harder!" For kids of the era there was nothing quite like The Legend of Zelda... other than Metroid.
It's not wonder that The Legend of Zelda went on to spawn its own sub-genre of games; arguably there are as many "Zelda-likes" as there are Metroidvania titles, and that's because this first game really set the template for a new kind of gaming experience. Its own sequels, and plenty of other games, have tried to take the template found here and remake it, sometime creating new ideas that would continue to influence the sub-genre, other times just iterating on the form. But none of those games get made without The Legend of Zelda. And, depending on how Nintendo functioned at the time, maybe The Legend of Zelda would have ended up a very different game if the Metroid team wasn't working on their game, too, sharing ideas around the water cooler.
Similarities to Castlevania Games
In the same way that Metroid went on to influence Castlevania II, you can also count The Legend of Zelda as an influential work. Coming out a year after both Metroid and The Legend of Zelda, Konami had to have taken notes on what worked, and what didn't, in the adventure genre before dreaming up Castlevania II. There's enough shared DNA that we have to consider The Legend of Zelda a founding parent of the Metroidvania genre.
That said, it feels like Konami's internal teams wanted to work the Zelda ideals further into Castlevania's tangentially related game, Getsu Fuma Den. That game blends Castlevania-style action with an overworld vaguely reminiscent of Zelda, along with a limited menu (and upgrading swords) that feel all too Zelda-like.
What we're saying, then, is that for a while there Konami really liked the cut of Nintendo's jib. They saw what Nintendo was selling and they bought it up (then re-released it as their own, with some tweaks).