D&D 5e doesn't simulate anything like this, so getting a meaningful estimate will be hard. And a plausible estimate might not be the best tack to take
(All costs are drawn from the Players Handbook, chapter 5, under Expenses)
Please note that this answer assumes a non-Eberron setting. Eberron has features which make an engineering project like this one more plausible, though no easier to estimate. We can make a few broad explorations, but they won't get us much of the way. If we're looking at the cost of raw materials and labor, we can get something like:
Materials
The linked massive submarine is 18,750 tons in dry dock, which is 37,500,000 pounds. If we assume that's all iron (perhaps a shaky assumption for something that will be constantly immersed in salt water), we can use the PHB-listed cost of 1 pound of iron costing 1 silver piece, which gives us 37,500,000 silver (3,750,000 gold) for the iron alone. This estimate assumes no mistakes are ever made in production, which is not very realistic, so this is a minimum cost.
But the physical material alone isn't enough. You're going to need mechanisms of some sort to do things like pump air, generate power to move the vessel, and so on. Such mechanisms probably don't exist in any generic way in most D&D settings, and so you'll need a lot of design work for them. And since many will be critical to the submarine functioning and/or people being able to survive in it, you'll probably want to thoroughly test and improve any designs you do end up with.
Finally, you'll also need various tools which would be necessary to construct something like this. For this I'm thinking of things like a dry dock. These will often be expensive as well, and will require materials and labor not included in the raw requirements for the submarine.
Labor
Labor for a submarine (particularly if it's something the workers have never worked on before) is going to require skilled workers. A skilled hireling is listed in the PHB as costing at least 2 gold pieces per day. How many labor-days are required to build your submarine is beyond my ability to estimate with any meaningful precision. But just to set the stage a bit, if each pound of iron takes half a labor-day to get into a final, usable state you would need 18,750,000 labor-days. If the dwarven city could contribute 500 laborers to work exclusively on this project until it's done, it could be completed in 37,500 days, which is just a bit over 100 years. If all 500 of those laborers are skilled hirelings, the minimum labor cost (based on the PHB) would be 37,500,000 gold pieces-- with these assumptions, that's 10 times the material cost.
Those are pretty baseless assumptions, but it would be expensive in any case. You'll also need extensive design work, thorough testing of components and different approaches to accomplishing things the submarine needs to function. On such a large scale project, overhead costs will also be substantial-- lots of supervisors to distribute and oversee work and accountants to monitor the vast amount of money being spent for example. These sorts of tasks aren't represented in D&D's simple economics.
One might suggest that magic can deal with some of these problems, but magic itself is a service that you'll need to buy. The PHB describes hiring someone to cast a level 1 or 2 spell might cost 10-50 gold pieces, plus expenses (such as for material components). At best, a magician helping on the project will provide at least as much value to you as any mundane laborer they might replace, and will likely be intelligent enough to be aware of that, and so any assumption that magic will make things less expensive is not well founded (though it may well make things faster, better, and/or easier).
Economic capacity
Another factor which is poorly represented in D&D settings is the productive capacity of economies. If the dwarven city has five blacksmiths in total, and all of them were willing to focus on this project, not only would the city not be getting any of its normal smithing work done but it's also doubtful that your submarine would ever be completed. The former point would ultimately make the work far more expensive (if it's even available for you to purchase), while the latter would make the work worthless. And you can't just add money to the price to solve this problem. In the real world in 1925, you could not buy a smartphone for any price-- the underlying technology and manufacturing methods didn't exist, and no amount of labor would overcome that.
These kinds of problems could be offset in a variety of ways, but D&D doesn't simulate that level of detail and so your DM will have to make a call. I don't think that, as players, you will be able to present much on the topic as finished concept work to your DM.
tl;dr: Assumptions abound, but the absolute minimum cost of this project is likely to be more than 40,000,000 gold pieces to get the submarine completed within a century.
What will you be doing with it?
This is probably the tack I would take as a DM whose players came with an idea like this. Money is ultimately not a very limiting resource in 5e, particularly for high-level play. If some task will cost X million gold pieces, but the DM is willing to work it into the game, your PCs will have access to the money somehow or other. Whether that's a fun adventure to liberate the treasure vaults of several genies and dragons, or a dull montage of fighting boars in the forest for a few centuries, arbitrarily large expenses are generally going to be arbitrarily surmountable.
If it's only a question of when you'll be able to afford the submarine, rather than if, then the actual cost is a poor choice to limit your ability to have it. I, as DM, would instead look ahead to the kinds of things you would be expecting to use the submarine to do and then set costs associated with building, maintaining, and operating the submarine in those endeavors against the expected rewards you might find.
If all you want the submarine for is to make dramatic appearances on the high seas, I might find some way for you to get it for free-- that's not worth much in-game grinding to accomplish (and Mammon always has cash lying around...). If, instead, you wanted to use it to intimidate all coastal and seafaring cities into paying your party tribute, I would be more likely to base the cost on the value of the tribute you could gain.
My honest suggestion: forget the numbers. Tell your DM what you want, and what you want to do with it, and let them make the process fun rather than realistic.
Realism for the sake of realism is fun for some players, but not all, and it doesn't apply so well with magical submarines in the first place. Level 19 is essentially post-game content anyways-- it's likely that you could do whatever you wanted in the game with or without this vessel.
As a DM I'm not very interested in putting hard obstacles between players and their goals. I want pursuit of those goals, meeting those goals, and having met those goals to all be fun and interesting. The cost and time required to build your submarine are so great that the DM will almost certainly have to arbitrarily declare it to be possible in the first place. It's also a difficult thing to fold into the setting of the game in terms of narrative and challenge. To your DM, plausible numbers are likely to be the least relevant constraints to putting the submarine in the game. Letting your DM figure out what would make it fun to have in the game is a better way to make a grand request than suggesting that, with enough cash, it should definitely fall into your hands.