|Dumbarton put Ayr under more pressure|
After early pressure from Sons, keeper Stephen Grindlay was called into action to thwart an Ayr breakaway, saving with his feet at point blank range.
Trialist Pat Walker had Dumbarton's first clear chance on the quarter hour, as Sons continued to pressure the visitors' area. But he was forced off-balance as he fired in on goal.
On 27 minutes Alan Cook put Dumbarton into the lead from the penalty spot after Keiran Brannan was tripped and Ayr went down to ten men. From then on Sons put together some fine flowing moves, but lacked a final punch.
With half time approaching Grindlay again rescued the home side, diving athletically to his right to tip away a firm shot from Danny McKay.
Jon McShane had the ball in the net for Dumbarton shortly after the restart, but it was disallowed for offside.
Then on 55 minutes trialist Walker, who had set up a number of chances for Sons, deservedly got the second goal with a well-taken strike past David Crawford and into the top corner.
Ayr target man Mark Roberts got one back for the visitors on 66 minutes with his 12th goal of the season - a well-timed header from an inswinging cross.
Dumbarton looked nervous as Ayr regained confidence, but substitute Ross Campbell sealed a vital three points for Sons with a breakaway goal on 83 minutes - in spite of Andy Rodgers' last minute strike back for Ayr to make it 3-2.