In reply to UP's 481, Baroda's first innings ended on 458 after a late resistance at the Golf Club Ground.
Baroda's last five wickets added 307 runs, but couldn't succeed in getting them the first-innings lead.
Baroda had been steadied by a 91-run stand between Kedar Devdhar and Irfan Pathan overnight, after having fallen to 151 for five.
The pair added a further 53 in the morning session on day three before Pathan was dismissed for a 98-ball 81.
However, Kuldeep Yadav dismissed both of them in a space of four overs before a run-out ended Baroda's innings.
UP's openers, Shivam Chaudhary (55 batting) and Almas Shaukat (61 batting), put on an unbroken 117 to take them to stumps with a 140-run lead.