With Walgreens Boots Alliance (WBA 0.50%) stock, investors get a very tiny slice of the pie whenever someone buys their prescriptions from one of the company's pharmacies. Thanks to its practically ubiquitous storefronts and its key role in the U.S. healthcare system, the business is an obvious candidate for a relatively conservative and long-term passive income investment. 

But how much would a $5,000 investment in Walgreens stock make if you held it for five years, and would it be a smart financial decision? Let's crunch a few numbers and estimate whether the stock will be a good passive income earner for your portfolio, or if its dividend is likely to get cut if times get tough. 

Still a reliable dividend

Walgreens makes money largely by getting consumers to buy medicines and consumer health goods from its pharmacies. That means it can benefit from two long-term tailwinds: population growth and more medicines prescribed per person over time. Those long-lived tailwinds help create the stable conditions that allow Walgreens to pay and increase its dividend. 

Presently, Walgreens' forward dividend yield is around 5.2%, which is much higher than the yield of around 2.3% offered by CVS Health, a major competitor. In the last five years, Walgreens' dividend grew at a somewhat unimpressive compound annual rate of about 3.7% per year, rising from $0.4 per share per quarter in 2017 to reach $0.48 as of Q3 in 2022.

But don't expect big hikes

More aggressive hiking of the dividend is unlikely as there aren't any major avenues that would allow the company to build on its revenue or earnings significantly -- at least, not within the next few years. While Walgreens can count on people continuing to buy prescriptions from its pharmacies, its growth initiatives, like diversifying into providing primary care and insurance, remain quite niche. In its 2022 fiscal year, its healthcare segment brought in only $1.8 billion, which is minimal compared to its top line of $132.7 billion. 

Nonetheless, dividend cuts are also improbable. The company has a 47-year streak of paying and hiking its dividend annually, and it's only paying out a relatively low 38.1% of its earnings to shareholders.

So if its dividend continues to grow at roughly the same rate as before, the company will be paying out a dividend of $0.58 every three months before the end of 2027. Therefore, a $5,000 investment at today's price would get you around $316.59 per year in dividends in around five years.

Even if you set up a dividend reinvestment plan (DRIP), that's probably a bit less growth than you'd get if you just parked your money in a market-tracking fund like the SPDR S&P 500 ETF Trust -- which, on average, expands at a rate of around 10% per year. Of course, your Walgreens shares could also gain in value, but that wouldn't change the annual payout.

So is Walgreens a good stock to buy?

If you're investing for passive income, the cash flow you get from holding Walgreens is a far more important consideration than the stock's performance relative to the market, so it could still be part of your strategy. And while there are plenty of other dividend stocks with higher yields, consumers will keep showing up to its network of pharmacies for years to come.

On the other hand, it's a risky move to invest in a thinly profitable business with shrinking top and bottom lines over the last three years. If you're not comfortable with harvesting dividends for the sake of spending them elsewhere, it's probably best to find another stock that's experiencing fewer headwinds.