I'm not really sure what you're asking, but I'll try to answer what I think the question is. In an equity market, people trade certain financial assets. The first point is, trading these assets on a secondary market is not consumption, and it's not investment. If you buy a stock for 100 on NASDAQ, you basically give the previous owner of the stock 100, and you get a piece of paper in return. That piece of paper entitles you to a share of earnings of the company, and that's why you think it's worth something. You can either enjoy the earnings over time, or sell the thing later.
So you had $100, and you could have consumed something, or you could have invested it, but you chose to trade that choice to someone else. Now he has to decide whether to consume or invest. In terms of the "real" economy, nothing happens. And nothing happens when you sell that stock. Money never "comes into" the market, and it never "leaves" the market. It just gets transferred between the buyers and sellers, and shares get transferred in the opposite direction.
So we see the question of what happens if money can't come into the system doesn't really make any sense. So what do indices reflect? They reflect some kind of expectation of the aggregate value of the shares in an index. That value is the expected discounted streams of earnings of the companies in the index. When the expectations rise, the indices rise. When they fall, the indices fall. Obviously, if we expect inflation, we expect earnings in nominal terms to rise, so that will make the indices rise. But that shouldn't be thought of as "more dollars chasing the same number of stocks." It's purely an earnings effect. The only thing that can make a stock more valuable is if its earnings expectations rise. Supply and demand, as understood in consumer goods markets, do not have much of anything to do with secondary equity markets. Just because people have more money to buy stocks with does not mean anyone will spend 100 dollars to buy a stream of earnings worth 95 dollars. (I say "much of anything". It would make this post too long to go into details, but if there is a surplus of demand for financial assets, risk premiums will drop, and prices will rise. This is a long story for a relatively small effect.)
I should mention another reason indices rise, because it's why we expect them to rise faster than economic growth. And that's because there's a selection bias in companies in indices: very poorly performing companies are booted, and more successful up-and-coming companies replace them.