Old English nearolice "with little breadth or extent, closely; strictly; carefully;" see narrow (adj.) + -ly (2). Meaning "only by a little, by a small distance" is attested from 1550s.
Entries linking to narrowly
narrow adj.
Middle English narwe, from Old English nearu "of little width, not wide or broad; constricted, limited; petty; causing difficulty, oppressive; strict, severe," from West Germanic *narwaz "narrowness" (source also of Frisian nar, Old Saxon naru, Middle Dutch nare, Dutch naar) which is not found in other Germanic languages and is of unknown origin.
In reference to railroads, narrow-gauge (also narrow-gage) is by 1841, originally of those less than the standard of 4 feet 8 1/2 inches. The narrow seas (mid-15c.) were the waters between Great Britain and the continent and Ireland, but specifically the Strait of Dover.
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.