Both teams finished with 10 men after having a player sent off in a fiery flare-up late in the first half. Monaco might regret not showing more passion earlier, having failed to win any of its six Group G games.
Turkish side Besitkas, which won 2-1 away to Leipzig, topped the group with 14 points - four more than Porto. Leipzig finished with seven and will play in the Europa League.
Monaco reached the semifinals of the competition last season by playing some scintillating attacking football. But it has been a very different story this season for the French champion and coach Leonardo Jardim's side was already guaranteed to finish last.
"It's sad not to be continuing in the Champions League, but that's football. Now we have to focus on the league and the two domestic cups," Monaco's top scorer Radamel Falcao said. "Our team changed a lot in the summer and we need time to get stronger."
Jardim, who oversaw the sale of five key players during the offseason, left Falcao and other regulars on the bench as he selected a largely second-string side.
It meant Monaco was wide open and Aboubakar took just nine minutes to put Porto ahead, latching onto a pass over the defense and drilling the ball past backup goalkeeper Diego Benaglio.
The Cameroon striker added his second after 33 minutes, cutting outside a defender on the left of the penalty area and curling the ball into the right corner. He then set up midfielder Yacine Brahimi on the stroke of halftime for a neat finish into the same corner.
"We had the desire to qualify and you could sense that from the first minute," Aboubakar said.
Shortly before Brahimi's goal, Monaco midfielder Rachid Ghezzal and Porto defender Felipe were red-carded in the 38th minute following a heated confrontation after Ghezzal was fouled.
Ghezzal stood up and pushed Felipe in the face and he responded angrily. They tried to get at each other again but teammates held them back.
After Monaco center half Kamil Glik pulled one back from the penalty spot in the 61st minute, defender Alex Telles made it 4-1 with a powerful header.
Falcao came on to head a goal back against his former club in the 78th, but forward Francisco Soares completed the scoring with Porto's fifth goal at the end.
"For me it was a huge pleasure to come here and play in Porto," Falcao said. "It's like my home. I won a lot of trophies here."
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.