Rob Greer's 3-pointer as time expired at the end of regulation sent the game into overtime tied at 62-all and capped a furious rally for the Blue Devils (2-5) who trailed 57-50 entering the final minute of the contest.
Ashanti Downey-Day's putback in overtime gave the Comets (8-1) a 66-64 advantage with 1:35 remaining.
Jay Ellis, who tallied a team-high 18 points and added seven rebounds and four steals, made the second of two free throws. James Henderson's steal and fast-break layup then put the Blue Devils in front 67-66 with 43 seconds on the clock.
Ellis stole another pass for Marietta and fed Greer for another fast-break layup for a 69-66 margin with 25 seconds left.
Kyle Wright's 3-point attempt missed the mark and Greer rebounded the ball with 4.3 seconds remaining, forcing South Gwinnett to foul.
Greer made the first of his two free throws with 3.5 seconds left for a four-point cushion that allowed Marietta to seal the win.
Greer finished with 15 points, including 10 in the fourth quarter, and chipped in with five rebounds and seven assists. Henderson posted seven points, while Anthony Jennings contributed 15 points and nine boards. Lee Moore had 13 points, while Brandon Martin collected six rebounds.
"Those guys - Rob, Jay and James - they're seniors," Marietta coach Matt Lyons said. "They've had a rough road this season, but that's what you want out of your seniors. Whenever there's time in the game, they have to step up and make the plays.
"We hung around long enough, and the guys got some confidence in themselves. Bottom line is, if we defend, we'll win. If we make shots, and defend like we can, we have a chance to be pretty good."
Ellis had seven fourth-quarter points, but none bigger than his 3-pointer, which pulled Marietta to within 57-53 with 58 seconds remaining in regulation.
A layup from Greer moved to Blue Devils to within 58-57 with 36 seconds left, but two free throws from South Gwinnett's Kevin Haynes put the Comets in front 62-59 with 6 seconds left in regulation, setting up Greer's game-tying 3-pointer.
South Gwinnett held a 42-37 lead entering the fourth quarter and the score was tied at 24-all at halftime.
Haynes had 14 points and three assists for the Comets, while Logan Adams contributed 12 points and seven boards. Qiydar Davis had nine points, while Downey-Day, who was named South Gwinnett's most outstanding player, finished with eight points and 13 rebounds. Kyle Wright also had nine points.
Greer was selected Marietta's most outstanding player.
"This win is big," said Lyons, whose Blue Devils played without leading scorer Dansby Swanson, who was out sick. "Even with our losses, we've had some things go our way, but we just couldn't get over the hump.
"South Gwinnett is an excellent team and, hopefully, this (win) sparks and gets us going earlier and we don't have to wait for the end of the season to get us going."