Mr Fonseca secured nearly 55% of the vote in run-off elections on Sunday, compared with Mr Sousa's 45%.
The two leaders contested the poll after President Pedro Pires stepped down at the end of his two terms.
Cape Verde is one of the most stable democracies in Africa, analysts say.
Mr Fonseca, 60, said he would focus on building Cape Verde's economy.
"My victory is one for democracy, for the dignity of the Cape Verdean people who believed in my plans," he is quoted as saying by the AFP news agency.More Cape Verdeans abroad
Mr Fonseca was the candidate of the opposition Movement for Democracy (MFD) party, while Mr Sousa was the flagbearer of the ruling African Party for the Independence of Cape Verde (PAIVC).
The two parties have dominated politics since Cape Verde, a former Portuguese colony, became independent in 1975.
Both have run the country for a 10-year stint each since the advent of multi-party democracy in 1991.
The PAIVC won parliamentary elections in February.
Its parliamentary majority will make it difficult for Mr Fonseca to govern without its backing and he is expected to choose a prime minister from its ranks, analysts say.
Cape Verde - an Atlantic archipelago of 10 islands - has experienced significant economic growth in recent years, partly due to a boom in tourism.
It is now classed by the United Nations as a middle-income country.
But unemployment and poverty are still high, forcing many people to emigrate.
More Cape Verdeans (700,000) live abroad than at home (500,000), official statistic show.