They're two of the oldest, largest, and most respected healthcare companies around. But one has made investors much happier than the other in recent years. Johnson & Johnson (NYSE:JNJ) stock is up more than twice as much as Pfizer (NYSE:PFE) stock over the past five years, and it's a similar story so far in 2017.

That's looking in the rearview mirror, though. Which of these healthcare stocks is the better choice for long-term investors now? Here's how Johnson & Johnson and Pfizer compare.

Two scientists in lab with beakers and test tubes

Image source:Getty Images.

The case for Johnson & Johnson

Some investors might have been concerned about Johnson & Johnson's growth earlier this year. Even the company's main growth engine, its pharmaceutical segment, seemed to be only muddling along. However, J&J posted more encouraging numbers in the third quarter, with growth in all three of its business segments.

There were two primary keys to that growth: acquisitions and increasing sales for several top drugs. J&J's acquisition of Swiss drugmaker Actelion helped boost its pharmaceutical performance, while the purchase of Abbott Medical Optics drove its medical devices segment revenue higher. New approved indications for Imbruvica, Darzalex, and Stelara also helped sales for the drugs increase.

Wall Street analysts project that J&J will grow annual earnings by close to 7% over the next five years. How will the company achieve that growth? Probably in the same way J&J did it in the third quarter. The company has hinted that it's looking for acquisitions to fuel better growth in its consumer business. J&J also should be able to count on continued success for several of its drugs, although it faces competition for top-selling Remicade.

J&J also has great expectations for its pipeline, particularly with the addition of Actelion. Market research firm EvaluatePharma ranked the company's pipeline as the fifth best in the biopharmaceutical industry. The company awaits regulatory approval for prostate cancer drug apalutamide and anticipates at least 10 submissions for new drugs and vaccines by 2021.

Investors should also like J&J's dividend. The company has an impressive track record of 55 years of consecutive dividend increases. Its dividend currently yields 2.36%.

The case for Pfizer

We should probably start out focusing on Pfizer's dividend. The company's yield of 3.51% stands as one of the best among big pharma stocks. Although Pfizer can't claim an impressive streak of dividend hikes like J&J can, the drugmaker appears to be committed to growing its dividend in the future.

While Johnson & Johnson is potentially looking to make acquisitions to beef up its consumer business, Pfizer is evaluating the possibility of selling or spinning off its consumer business. If the company follows through, this would likely be great news for investors.

Wall Street thinks Pfizer will grow earnings by a little under 6% annually over the next five years. The company expects several current products to help fuel that growth, especially cancer drug Ibrance and anticoagulant Eliquis. A couple of drugs picked up in acquisitions should also be important in Pfizer hitting analysts' projections -- atopic dermatitis drug Eucrisa and prostate cancer drug Xtandi.

Pfizer has a strong pipeline, with 32 late-stage programs. The company also awaits several regulatory approvals, including potential new indications for Xeljanz in psoriatic arthritis and ulcerative colitis.

The weak link for Pfizer right now is its essential health business segment, which includes legacy drugs that have either lost exclusivity, or soon will do so. However, this segment also includes Pfizer's biosimilars. The company thinks its biosimilar business can be a major source of growth in the future.

Better buy

One thing that hasn't been mentioned so far is valuation. Johnson & Johnson stock currently trades at 18 times expected earnings, while Pfizer has a forward earnings multiple of only 13. I think this big valuation gap is important. Pfizer's growth might lag behind J&J's a little over the next few years, but investors can buy that growth at a discount compared to what they'd pay for J&J.

Although it's a tough choice, I give the slight edge to Pfizer. My view is that Pfizer is the better bargain. I also think that Pfizer's total return, including reinvesting dividends, should outperform J&J over the next five years.

Both of these stocks, though, should be winners over the long run. My take is that investors won't go wrong buying either of them.