Portadown gained their first win in six league matches thanks to a Gary Twigg penalty with the last kick of the game.
Carrick Rangers substitute Ryan Kane fouled Portadown defender Ross Redman and Twigg beat keeper Brian Neeson from the spot deep into stoppage-time.
The win takes Ronnie McFall's men above Glentoran and into sixth place in the Irish Premiership table.
In the first half, Twigg had a shot pushed away by Neeson while Carrick's Ben Roy flashed a shot wide.
What they said
Portadown manager Ronnie McFall: "This league is relentless, you have good phases and you have bad. Hopefully this win will start a bit of a run for us.
"It is the first time we have kept a clean sheet this season which is a big plus for us.
"We might have been fortunate, but it was a definite penalty kick."
Carrick Rangers manager Gary Haveron: "It was a much more committed performance from us after last week's debacle at Crusaders and we deserved at least one point.
"The penalty was a cruel way to finish the game for us."