The archipelago of volcanic islands off the western coast of Africa secured one of the nine automatic spots for the continent on Monday.
Cape Verde will be the second smallest country by population to feature in the tournament after Iceland in 2018.
Dailon Livramento scored in the 48th minute, Willy Semedo in the 54th and Stopira in stoppage time to secure the home victory and first place in Group D.
The Blue Sharks finished with four more points than Cameroon, who could do no better than draw 0-0 with Angola at home.
Cape Verde, a nation of about 525,000 people, arrived needing a victory, and could have qualified even with a loss as long as Cameroon didn't defeat Angola.
The nine group winners automatically qualify for the World Cup. The four best runners-up play in a mini tournament of two semi-finals and a final in November, so Cameroon can still advance as a runner-up.
Tickets for the Cape Verde match were sold in record time and the government declared a half-day holiday across the country so people could watch the game.
On Sunday, Ghana became the fifth African nation to qualify, joining Tunisia, Algeria, Egypt and Morocco at next year's tournament in the United States, Canada and Mexico.