Depends on what you mean by gameplay, I think the three most important areas of gameplay in an rpg are tactical combat, exploration, and character building.
Tactical combat - further subdivided in games with good combat engine, and implementation of rulesets, and games that have good encounter design.
Engine: TOEE, Jagged Alliance 2, Goldbox games, Knights of the Chalice, Natuk, Dark Sun, Blackguards, Wasteland 2, Fallout. Basically any game that is a) turn-based b) has grid-based movement(also, hex>square) or similar enough, and proper positioning, and c) gives you a wide range of options in combat, the paradigm being JA2 where you can crouch, lay prone, aim at limbs, etc.
Encounters: Jagged Alliance 2, Baldur's Gate 2, Icewind Dale series, the higher level Goldbox games like Dark Queen of Krynn and Pools of Darkness, Wizardry series, Elminage series and Labyrinth of Touhou 2.
A lot of these games have flawed combat engines, such as the Infinity Engine games which are RTwP, and blobbers, which allow for only very limited positioning, thus eliminating or at least severely simplifying an entire layer of tactics. Some of these games nevertheless manage to have excellent combat by virtue of their encounter design and by compensating for the simplified(or in the case of IE, distorted) system of positioning by transfering tactical depth to the system of spells, status effects, buff/debuffs, skills, etc. Handcrafted encounters are good and BG2 does them well, but procedurally or semi-procedurally generated ones can still be tactically satisfying if the ruleset and the AI are good enough.
The games with the best combat are probably those that have both of these things like Jagged Alliance 2 and Pools of Darkness.
Character Building - to be subdivided in character creation and character development. Also, only systems with full party creation/development are included here as whatever the strengths of a particular character system(e.g. Fallout, NWM), it will never have its potential fulfilled until it is integrated within full party customization.
Character creation: Wizardry, Elminage series, TOEE, Goldbox games, Icewind Dale series (especially 2).
Self-explanatory, an interesting system of character creation, it doesn't have to be super-detailed in the amount of things you can actually modify like Daggerfall(though this is good), but at least it has to have a large amount of intrinsic complexity that is not obvious unless you look under the hood. Early DnD games and Wizardry are a good example of the latter.
Character development: Wizardry 1-5, Wizardry 7, TOEE, Icewind Dale 2.
Generally this can be done well in two ways, by a perk/feat system or by a system that encourages class-changing, provided the class system is robust enough to make class stacking interesting, as was the case in the old Wizardry games and Elminage. Perk/Feat systems are perhaps a more sophisticated alternative to this, since they allow the player to exercise agency throughout the development of his characters that feels qualitative and not just quantitative, while retaining the sense of specialization that class-change systems sometimes dilute. The least interesting form of chardev IMO is ability/skill scores, in other words, systems where character development consists of merely pumping up the score of a skill or attribute(e.g. Wizardry 8), this can however, complement and slightly improve a system that successfully implements feats or class-changing, such as Fallout and Wizardry 7 respectively.
Again, the best character building is often found in games that combine both of these things successfully, such as TOEE.
Exploration - further subdivided in dungeon and overworld exploration.
Dungeon exploration: Wizardry 1-5, Elminage series, Generation Xth Code Hazard.
I'd say dungeons tend to synergize better with gameplay than overworlds, perhaps due to their inherently 'gamey' nature. They tend to have traps and obstacles of all sorts that can then easily be linked with the character system(disarm trap, pick lock skills), and since it is easier to get lost on them, they often offer more opportunities for exploration tools(skills, magic,etc) to make themselves useful. In old-school dungeon crawlers you also usually cannot save or rest inside dungeons which means that resource management synergizes with labyrinth exploration and charting in order to create an strategically robust challenge on its own right and quite apart from the tactical combat and character/party optimization. Old school Wiz, 1-5 specifically, do this flawlessly, and their Japanese successors, especially Elminage have ensured the survival of this craft.
Overworld exploration: Might and Magic series, Elder Scrolls series(except Oblivion).
Well, I really like overworld exploration where I have found it, but I think overworlds in RPGs are rarely able to offer as much gameplay value that dungeons do, in terms of resource management, making it difficult to find your way, and avoiding traps. They sometimes do offer these things, but always to a lesser extent than dungeon crawlers do. It's good to have pretty looking overworlds that also serve as vessels for interesting lore and environmental storytelling, like Morrowind, but this is not enough from a gameplay perspective, but only from an atmospherefag and lorefag perspective. Actual survival in the gameworld should be challenging and strategic for it to really shine as gameplay. As has been said of dungeons, they are often an enemy in themselves, and one of the cool things about dungeon crawlers is the feeling of conquering a dungeon. Overworlds tend to underperform in these regards, and frankly it is not necessarily for lore and cohesiveness reasons only (e.g. some would argue that making a world too gamey would break immersion) as there are many fantasy and sci-fi settings in which a hostile living world a la Alpha Centauri could be implemented, and this would allow for all sorts of obstacles and mechanics to be embedded in exploration, not to mention the opportunities offered by post-apocalyptic settings where minefield-ridden areas would be lore-friendly. A step in the right direction would be to take away save-anywhere and rest-anywhere privileges from the player, and have armor and weapon degradation, low-ammo, etc to make survival an interesting mechanic in and of itself. The saturation of overworlds with fauna, flora, and landmarks also allows for creative hiding spots for loot and collection of supplies. But perhaps I am being a bit too harsh here, at the end of the day overworlds are mostly fine, especially since there are often actual dungeons to explore in the best overworlds anyway, and one of their strengths is the variety in environs that they provide, which helps against repetitiveness and tedium during exploration, and the two series mentioned above probably do this particular aspect best. Daggerfall deserves mention for having more city than overworld exploration proper, but it is still easily among the best in terms of non-dungeon exploration due to the amount of interactivity with the enviroment and customization of things that it provides.
So yeah, good gameplay can mean a lot of things. You could say that the best gameplay is that of games that have all of the above, but those are unicorns. Most games specialize in something they do very well and then they 'dump' some other area of design. The most well-rounded model of rpg I've seen is the old Wiz 1-5 model which has great exploration, good combat, and good charbuilding, most of the others are mediocre or outright sucky in at least one area, so pick your poison. To make a military analogy, character building is the strategic layer (so long as there is no respec), exploration and resource management are the operational layer, and combat the tactical layer. So go with those games that specialize in the layer you prefer. All of the games mentioned above have good rpg gameplay and are worth playing for it alone, they just specialize in different areas.