The Bulldogs, who snapped Army's three-game winning streak, led 66-61 with 1:48 left in regulation, then Matt Gramling's 3 and Andrew Shire's two foul shots forced overtime.
Ellis scored all eight of the Black Knights' points in the second extra period, hitting two 3-pointers and two free throws for an 83-81 Army lead with 43 seconds left.
Martin then entered the game and knocked down his trey.
Ellis made 10 of 20 field goals and 14 of 15 free throws for Army (3-2).
Amin Elhassan and Myron Medcalf break down Marquese Chriss being traded to the Suns.
Amin Elhassan and Myron Medcalf break down how Jaylen Brown will fit in Boston
Amin Elhassan and Myron Medcalf break down how Jamal Murray will fit with Emmanuel Mudiay in Denver.