Or would you stay in the stock market?

We plan to move in about 4 years to a small town with a much lower cost of living; it's 3 hours from where we are now. We have $150k available to invest in a home (which we would rent out until we move), or we can leave it in the stock market where it has been performing extremely well. We can rent out the house to cover the mortgage and then some as it's in a very nice neighborhood. Purchase price would be around $375k.

Of course, it's all a gamble since we don't know where the stock or real estate markets will be in 4 years. Just wondering what folks who have invested in real estate in the past might think. We've never really wanted to be landlords, this just seems like maybe it might be a good time to cash in some profits and invest in a house. Our current house is paid off and our retirement is fully funded. No kids, so no need to save for college, etc.