Paul McLean put Brechin ahead in the first half but Gemmell equalised in the second with a deflected shot. Sean Dickson fired the hosts ahead and Gemmell netted again with a 64th-minute header. Andy Jackson pulled one back.
Michael Moffat scored his 50th Ayr United goal as his team cruised to a 4-1 victory at East Fife. Michael Donald netted a stunning 29th-minute opener for the visitors and Moffat curled home seven minutes later.
Liam Buchanan hit back with a 43rd-minute penalty but Scott McLaughlin headed in Ayr's third and Donald scored again in the final minute.
Arbroath beat Airdrieonians 3-2 in a feisty encounter at Gayfield. Lee Erwin got the winner from the spot two minutes from time after Airdrie had Chris O'Neil sent off.
Stranraer rallied from a goal down to win 2-1 at home to Forfar Athletic. Chris Templeman drew first blood but Jamie Longworth levelled and Chris Aitken's 36th-minute goal gave the hosts the points.