Hamilton controlled the puck in the slot off a deflection, turned and snapped a shot past Jacob Markstrom to end the sixth-longest game in the AHL's 79-year history.
At 120 minutes, 16 seconds, the game fell more than a period short of the AHL record of 142:58 set in Philadelphia's 3-2 victory over Albany in five overtimes in Game 5 of the 2008 East Division semifinals.
Richard Bachman made 56 saves for Oklahoma City, the Edmonton Oilers' farm team. The victory was Oklahoma City's third in the playoffs after the Barons set a league record with 14 OT wins in the regular season.
Markstrom stopped 65 shots for Utica, affiliated with the Vancouver Canucks.
Kent Huskins opened the scoring for Utica in the first period, and Connor Jones tied it in the second.
Game 2 is Friday night in Utica.