The visiting side were up first and they managed to reach 170-4 at the County Ground, thanks in large to the work of Colin Ingram (96) who fell just short of a century.
Graham Wagg (33*) also helped put Glam further ahead, in what turned out to be an unassailable lead.
Jim Allenby was the first to fall for the hosts with just five runs on the board, and things hardly improved for Somerset when Johann Myburgh (19) and Peter Trego (33) fell soon after to leave them stranded on 82-3.
Glamorgan were left looking over their shoulder, however, as their opponents quickly closed in on their tally of 170. But while Ingram starred with the bat, Wayne Parnell impressed with his final-over bowling to keep the home side at bay.
Tim Groenewald had so very nearly snatched victory for Somerset with an unbeaten 27 from nine balls, until Parnell restricted the opposition to eight runs in the final over to secure the win.