Senegal s forward Sadio Mane (C) is challenged by Burkina Faso s midfielder Adama Guira (L) and Burkina Faso s midfielder Gustavo Sangare during the Africa Cup of Nations (CAN) 2021 semi final football match between Burkina Faso and Senegal at Stade Ahmadou-Ahidjo in Yaounde on February 2, 2022 (AFP)
Aliou Cisse's team had two penalties awarded in the first half only for the Ethiopian referee to change his mind both times following a VAR review.
However, they went ahead just after the midway point in the second period when Paris Saint-Germain defender Diallo popped up in the box to produce a striker's finish.
The second arrived on 76 minutes as Mane provided a superb assist for Gueye, also of PSG, to score, and Mane completed the win late on after Blati Toure had pulled a goal back.
Africa's top-ranked national team, Senegal will find out their opponents in Sunday's final on Thursday, when hosts Cameroon take on Egypt in the second semi.
Those two nations are the most successful in AFCON history with 12 titles between them, while the Lions of Teranga are still searching for their first continental crown, two and a half years after losing to Algeria in the final in Cairo.
Their opponents here could not be underestimated.
Burkina Faso have shown themselves to be a talented young side and one driven on by the desire to give joy to supporters in a country reeling after President Roch Marc Christian Kabore was overthrown in a military coup last week.
That happened to a backdrop of a jihadist insurgency in the landlocked country, and their coach, Kamou Malo, talked of the events giving his team "added motivation".
They showed plenty of fight and matched their opponents for long spells, but they did not trouble Chelsea's Edouard Mendy in the Senegal goal often enough.
Mendy's opposite number, Herve Koffi, was stretchered off half an hour in after landing horribly as he went up to punch the ball clear in an aerial challenge with Cheikhou Kouyate.
Referee Bamlak Tessema initially gave a spot-kick before changing his mind after a VAR review, as Kouyate was able to resume but Koffi could not.
Tessema also pointed to the spot in first-half injury time when a Gueye shot struck the arm of Burkina Faso's Edmond Tapsoba in the area, but again he changed his mind after a review of the images showed the defender's arm was in close to his body.
The breakthrough arrived with 20 minutes left, Kalidou Koulibaly trying an acrobatic attempt at a corner and inadvertently setting up Diallo to score, beating substitute 'keeper Soufiane Farid Ouedraogo.
Senegal's pressing made the second goal as Mane got to the byline and set up Gueye, who just beat Bamba Dieng to the finish.
It was always going to be a huge ask after that for the Stallions against a Senegal side who had conceded only once in the whole tournament.
However, they reduced the deficit eight minutes from time as Issa Kabore's cross was diverted in by Toure's knee.
Mane had the final say, though, bursting clear in the 87th minute to make it 3-1.
He will find out on Thursday if he will come up against his Liverpool teammate Mohamed Salah and Egypt in the final.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)