The Railroaders (8-0) took a 49-42 lead on a Kevin Goode free throw with 4 minutes, 37 seconds left in the fourth quarter. But back-to-back turnovers and a pair of missed free throws by Brunswick led to the start of a 9-0 run by the Wildcats.
Williamsport (5-2) forced three more turnovers in that run, all of which led directly to points. Chris Barton stripped the ball away from Brunswick's Kyle Barnette, then scored off a feed from Ryan Grabill to pull the Wildcats within 49-47.
Corey Wolfensberger grabbed a pass out of the air and drove for a layup to tie the score with 39 seconds left. Barnette had the ball stripped again and Williamsport's Barrett Giles passed ahead to Barton for the go-ahead lay in with 23 seconds remaining.
But Roscoe Dorsey was fouled along the baseline for Brunswick with 7 seconds left, and he netted both free throws to tie the score again and force overtime.
Williamsport took a three-point lead in the first overtime on a free throw by Wolfensberger, but Mike Dykes scored five straight to put the Railroaders back in front 58-56 with 34 seconds to go.
Giles grabbed an offensive rebound and was fouled while shooting. Again, with 7 seconds on the clock, Giles hit both free throws to force the second overtime.
Zack Borden's 3-pointer at the start of the second extra period gave Brunswick the lead for good.
"You hope games like this are going to help you come playoff time, and that's probably as close to playoff atmosphere as you'll find," said Williamsport coach Deron Crawford. "There are a lot of things we can get out of this. We fought and believed we could get back in it, and we did."
Dykes had 18 points and Barnette had 17 for Brunswick. Wolfensberger had 19, while Barton and Grabill each had 13 for WIlliamsport.
In the consolation game, North Hagerstown outscored South Hagerstown 24-11 in the second quarter on its way to a 79-67 win over the Rebels.
Tater Russ led North with 20 points, while Evan Medley added 17. Alberto Valentin had 20 and Mike Jeter had 18 for South.
All-tournament team: Dykes, Dorsey, Wolfensberger, Grabill, Jason Ott (North Hagerstown).
Brunswick 70, Williamsport 67
Borden 6, Barringer 2, Barnette 17, Dorsey 10, McLane 10, Dykes 18, Goode 7. Totals 27 10-25 70.
Wolfensberger 19, Grabill 13, Barton 13, Giles 6, Martin 6, McAllister 8, Weaver 2. Totals 23 18-26 67.
Three-point goals - Brunswick 6 (Borden, Barnette 3, Goode 2), Williamsport 3 (Wolfensberger, Grabill, Barton).
North 79, South 67
SOUTH HAGERSTOWN (67)
Valentin 20, Fowler 4, Maas 6, Jackson 3, Lee 11, Jeter 18, Barish 2, Creek 3. Totals 23 20-33 67.
NORTH HAGERSTOWN (79)
Rice 8, Naylor 5, Russ 20, Everett 4, Ott 14, Medley 17, Rodgers 7, Crivari 4. Totals 27 22-34 79.
Three-point goals - South Hagerstown 1 (Valentin), North Hagerstown 3 (Russ, Medley, Rodgers).