The French-born Mali forward scored the only goal of the game four minutes into the second-half as Porto claimed their first win in Group D, leaving the Portuguese champions level on points at the top with Schalke and one ahead of their Turkish opponents.
In an end-to-end encounter both sides created chances with Casillas using his experience and quality to maintain a clean-sheet for the hosts
Former Real Madrid goalkeeper Casillas, taking part in his 20th Champions League campaign, made two important saves with his legs just before half-time.
Porto broke the deadlock when Alex Telles swung in a cross from the left that found an unmarked Marega to head home from close range.
Garry Rodrigues missed a chance to level by firing over after a one-two with Gumus and Muslera denied Marega a second goal after the Porto forward broke clear of the Galatasaray defence.