Re:So, if one fire dept. was fighting a fire which spread into another's territory (e.g. by leaping from one side of the street to the other), would they refuse to fight the portion of the fire outside their own territory?

in theroy yes, but in actuality, no. NYC fire department has responded to disasters in Suffolk county ( eastern end of long island, more than 50 miles distant from east edge of NYC's eastern most border in queens.--plane crashes come to mind)
and when the World Trade center was bombed in '93, those same firedepartments "took over" responsibilty for parts of queens, while the queens firefighters headed into manhattan.

with the destruction of WTC, firemen were paid (on duty) from NYC, many towns in NJ, and Westchester. later, many firemen vollunteered, and NYC was filled with firemen from all over US (and world, we had English, french, and Canadians, and lots of other firefighters. )

likewise, when SF had that bad earthquake, NYC fire fighters were offered (and took) paid leave to go to california, and work.. (so they didn't use vaction time)
there might be formal reciprial agreements, in some places, but here, in NY the things seem to be worked out with fire chiefs, and handshakes.