With just eight minutes on the clock, Larne hit the front after a calamitous piece of Portadown defending.
A seemingly harmless long ball forward led to a mix-up in the air between Baris Altintop and Aaron Traynor with the ball running through on goal.
Cosgrove benefitted and rounded goalkeeper Jamie Barry before slotting home for his first goal of the season.
The hosts struggled to get into the game and had to wait until the 27th minute before they had their first effort.
A cross from the right found its way to substitute Matty Carson at the back post, but his weak shot was easily saved by Rohan Ferguson.
On 28 minutes, Portadown were given a lifeline when O'Hara was sent off for a high foot that made contact with the head of MacKinnon.
There appeared to be little malice in the challenge, but referee Michael McKenna took a different view and produced the red card.
Just before the break, Ferguson took an age with the ball at his feet before drilling it off attacker Eamon Fyfe, with the ricochet heading towards goal before the stopper made it back to rescue the situation.
Eight minutes after the break Barry failed to get close to a corner and Cosgrove headed onto the upright at the back post.
On 55 minutes the game was over when Matty Lusty drove forward into the Portadown half before sending Graham clear through on goal and he slotted calmly past Barry and into the net.
The Ports could have grabbed one back at the death when substitute Ahu Obhakhan had a clear shot at goal from six yards, but he dragged his effort wide of the near post.