The provisional results from Sunday's vote showed President Macky Sall's BBY won 82 out of 165 seats, while the alliance of opposition coalitions Yewwi Askane Wi (YAW) and the Wallu Senegal won 80.
BBY secured 125 seats in the last legislative poll in 2017, and the loss of 43 seats reflects growing public acrimony towards Sall, fuelled in part by his refusal to state clearly whether he plans to run for a third mandate in 2024 in breach of term limits.
Frustrations in the usually stable west African country have also been stoked by economic hardship linked to the coronavirus pandemic and rising fuel and food prices.
"The Senegalese people gave a real lesson in democracy to the political class," BBY member Amadou Sall told Reuters.
There was no immediate official reaction from any of the parties.
Both BBY and the YAW-Wallu alliance had earlier claimed victory, although opposition leader Ousmane Sonko said the ruling coalition would try to steal the vote and called for his supporters to be ready to defend their choice.
On Thursday, YAW, which Sonko's PASTEF party is a member, said it would not accept the results, citing alleged voting irregularities in northern regions.
A BBY representative said those claims were baseless.
The election commission has not commented on the allegations and YAW says its request to look into the irregularities has been rejected by the commission.
Tensions have run high in the country of 17.5 million since violent protests broke out last year, when Sonko, who came third in the 2019 presidential election, was arrested on rape charges. Sonko denies the allegations. The case against him is still open.