In a video, Priyanka Gandhi can be seen greeting and waving at the SP chief, who was riding in a repurposed campaign bus with Rashtriya Lok Dal (RLD) chief Jayant Chaudhary.
Both Yadav and Chaudhary returned the gesture and waved back at the Congress leader.
Akhilesh Yadav shared a photo of the interaction on Twitter and said, "Ek dua salaam - tehzeeb ke naam (Greetings to you)."
Meanwhile, workers and supporters of the SP and Congress can be seen cheering and raising their flags at each other.
Gandhi tweeted a video of the interaction saying, "Humari bhi aapko Ram Ram (Hello to you too)."
The 2022 state Assembly elections will begin with the first phase of voting in UP on 10 February and will end on 7 March, with the seventh and last phase of the polling in the state. The counting of votes will be held on 10 March.
While Gandhi and Yadav have often taken jibes at each other, they have largely been cordial in person.
The two earlier had a chance meeting in October 2021, when the two came across each other in a Delhi-Lucknow flight.
Though the Congress and the SP had joined forces in 2017, their alliance did not yield great results. While the Congress won just seven of the 105 seats it contested, SP won on 47 seats (down from the 224 it had won in 2012).
Considering this, Yadav had told NDTV in June 2021, "We did not have a good experience in 2017 - we gave them over 100 seats but we could not win. UP has rejected the Congress… I will not get into any alliance with them."
(With inputs from NDTV.)