Thistle's victory saw them overtake Morton to go second in the league.
Partick started brightly, and the first chance came after only three minutes when Mark McGeown in the Ayr goal, had to be at his very best from a corner. The keeper was again in top form to deny Graham Dorrans' snap-shot from 10 yards.
Following their early flurry there was few chances for either side, and the game was only livened up by an on-field spat between Thistle goalie Colin Stewart and his own centre- back Marc Smyth. This fracas appeared to affect Thistle, and Ayr came more in the game but were unable to create any chances.
With the break looming Thistle took a deserved lead when good play between Dorrans and Roberts led to Roberts passing the ball into the path of Jukka Santala, who made no mistake from 14 yards.
The second half saw Thistle dominate the early exchanges, and Sean Kilgannon should have done better after 48 minutes but his shot missed the target.
Ayr did have a couple of chances, their best falling to Boyd after 65 minutes when the Thistle defence failed to clear a corner. Boyd, from just one yard out, completely missed the ball, much to Thistle's relief.
After 73 minutes McGeown was called upon yet again to keep his side in it when he pulled off a double save, first from Gibson and then Mark Roberts' follow up.
The last chance of the game fell to Ayr in injury time, and Robertson's header from six yards appeared to be goal-bound but Stewart somehow saved and the ball was cleared to give Partick all three points and second place in the league