With fears of a recession heightening on Wall Street, some might think it's best to steer clear from investing in equities. But as long-term investors know, holding shares of great companies through economic and market downturns is one of the keys to earning excellent returns in the long run.

Whether or not a recession is coming, investors can still look to the stock market to increase their wealth. Two stocks that can help them do that are Sanofi (SNY -0.47%) and Block (SQ 2.32%). Let's consider why. 

1. Sanofi

France-based biotech Sanofi has outperformed the market in the past year despite financial results that haven't always been stellar. In the second quarter, the company's revenue declined by 1.5% year over year to almost 10 billion euros ($10.6 billion). Some of the company's products are seeing their sales decline due to generic and biosimilar competition, as well as lower demand for coronavirus medicines. However, Sanofi's overall business remains strong.

First, the drugmaker's most important growth driver -- eczema treatment Dupixent -- is firing on all cylinders. In Q2, Dupixent's sales soared by 34.2% year over year to 2.6 billion euros ($2.8 billion). Dupixent could earn a label expansion in treating COPD relatively soon, which would help its revenue growth rate improve meaningfully. Sanofi also earned approval for a critical product this year, namely Beyfortus, a vaccine for respiratory syncytial virus (RSV).

Sanofi entered the (very) new RSV vaccine market, which, according to some projections, could soar to $10 billion by 2030. The biotech could be one of the winners in this field. Sanofi's portfolio of newer products also includes hemophilia treatment Altuviiio and Tzield, which is the first therapy approved by the U.S. Food and Drug Administration to delay the onset of type 1 diabetes.

Sanofi should successfully unearth more key products, considering the several dozen programs -- including 21 late-stage clinical trials -- in its pipeline. That's why Sanofi continues to perform well. The effect of older products whose sales are decreasing will fade over time, while newer therapies will take over and help improve Sanofi's financial results. And as a longtime leader in the biotech industry, Sanofi won't go anywhere anytime soon.

The company should continue delivering solid stock market performances in the next half-decade and beyond, thereby making its shareholders richer.

2. Block

The fintech industry is growing -- and highly competitive. Block is a company that has successfully carved out a niche for itself in this market thanks to its two core ecosystems, Square and Cash App, which target businesses and individuals, respectively. Square offers various services, including the company's original card processing business, invoicing, inventory management, and data analytics.

Cash App is a peer-to-peer payment app that offers banking services, from debit cards and direct deposits to trading stocks and cryptocurrency. Both arms of Block's businesses are performing well. In Q2, the company's total revenue of $5.53 billion increased by 26% year over year. Square gross profit came in at $888 million, 18% higher than the year-ago period. Cash App's gross profit of $968 million was up 37%, compared to the prior-year quarter.

In total, Block's gross profit increased 27% year over year to $1.87 billion. Also noteworthy: It ended Q2 with 54 million active users on Cash App, up 15% year over year. This number has been growing for a while, and it makes sense given that Block continues to add new products to Cash App and the app's network effect.

The company's Square ecosystem also arguably benefits from high switching costs. Once plugged into Square's network, businesses depend on the services it offers daily. They are unlikely to disrupt the flow of their operations by switching to a competing provider. Block's competitive advantage across its business is an excellent reason it can remain a leader.

The company is well-positioned to ride the wave of the growing fintech industry in the coming years and deliver superior returns for its shareholders.