TL;DR: basically any language with strong etymological connections to English (plus Hebrew).
There's a lot of information about languages in Appendix F of The Lord of the Rings (itself a condensed version of "The Appendix on Languages", Volume 12 Chapter 2 of The History of Middle-earth), in which Tolkien strictly maintained the conceit that LotR itself was a true story and he had merely translated and modernised it. It's worth reading Part II of this appendix, "On Translation", in full, if only to appreciate the extent of Tolkien's imagination and creativity at least in matters of language, but here I'll provide only the most relevant excerpts to understand the essentials.
In presenting the matter of the Red Book, as a history for people of today
to read, the whole of the linguistic setting has been translated as far as
possible into terms of our own times. Only the languages alien to the Common
Speech have been left in their original form; but these appear mainly in the
names of persons and places.
The Common Speech, as the language of the Hobbits and their narratives, has
inevitably been turned into modern English. In the process the difference
between the varieties observable in the use of the Westron has been lessened. Some attempt has been made to represent these varieties by variations in the
kind of English used; but the divergence between the pronunciation and idiom of the Shire and the Westron tongue in the mouths of the Elves or of the high men of Gondor was greater than has been shown in this book. Hobbits indeed spoke for the most part a rustic dialect, whereas in Gondor and Rohan a more antique language was used, more formal and more terse.
-- LotR, Appendix F, Part I "On Translation"
As part of this process, he says, he not only translated the Common Speech into more-or-less modern English, but also created linguistically suitable connections between other Middle-earth languages and their 'translations'. This is a device he used so as not to break linguistic suspension of disbelief - something which most readers would have noticed or cared about far less than he, a professional linguist.
Translation of this kind is, of course, usual because inevitable in any
narrative dealing with the past. It seldom proceeds any further. But I have gone beyond it. I have also translated all Westron names according to their senses. When English names or titles appear in this book it is an indication that names in the Common Speech were current at the time, beside, or instead of, those in alien (usually Elvish) languages.
The Westron names were as a rule translations of older names: as Rivendell,
Hoarwell, Silverlode, Langstrand, The Enemy, the Dark Tower. Some differed in
meaning: as Mount Doom for Orodruin 'burning mountain', or Mirkwood for Taur e-Ndaedelos 'forest of the great fear'. A few were alterations of Elvish names: as Lune and Brandywine derived from Lhûn and Baranduin.
This procedure perhaps needs some defence. It seemed to me that to present
all the names in their original forms would obscure an essential feature of the times as perceived by the Hobbits (whose point of view I was mainly concerned to preserve): the contrast between a wide-spread language, to them as ordinary and habitual as English is to us, and the living remains of far older and more reverend tongues. All names if merely transcribed would seem to modern readers equally remote: for instance, if the Elvish name Imladris and the Westron translation Karningul had both been left unchanged. But to refer to Rivendell as Imladris was as if one now was to speak of Winchester as Camelot, except that the identity was certain, while in Rivendell there still dwelt a lord of renown far older than Arthur would be, were he still king at Winchester today.
-- ibid
He also goes into a lot more detail about precisely which languages and dialects of Middle-earth correspond to which in the real (sorry, modern) world.
Most Hobbit names: ENGLISH.
The name of the Shire (Sûza) and all other places of die Hobbits have
thus been Englished. This was seldom difficult, since such names were commonly made up of elements similar to those used in our simpler English place-names; either words still current like hill or field; or a little worn down like ton beside town. But some were derived, as already noted, from old hobbit-words no longer in use, and these have been represented by similar English things, such as wich, or bottle 'dwelling', or michel 'great'.
-- ibid
Older Hobbit names: FRANKISH or GOTHIC.
In some old families, especially those of Fallohide origin such as the
Tooks and the Bolgers, it was, however, the custom to give high-sounding
first-names. Since most of these seem to have been drawn from legends of the
past, of Men as well as of Hobbits, and many while now meaningless to Hobbits
closely resembled the names of Men in the Vale of Anduin, or in Dale, or in the Mark, I have turned them into those old names, largely of Frankish and Gothic origin, that are still used by us or are met in our histories. I have thus at any rate preserved the often comic contrast between the first-names and surnames, of which the Hobbits themselves were well aware. Names of classical origin have rarely been used; for the nearest equivalents to Latin and Greek in Shire-lore were the Elvish tongues, and these the Hobbits seldom used in nomenclature. Few of them at any time knew 'the languages of the kings', as they called them.
-- ibid
Buckland names: CELTIC.
The names of the Bucklanders were different from those of the rest of the
Shire. The folk of the Marish and their offshoot across the Brandywine were in many ways peculiar, as has been told. It was from the former language of the southern Stoors, no doubt, that they inherited many of their very odd names. These I have usually left unaltered, for if queer now, they were queer in their own day. They had a style that we should perhaps feel vaguely to be Celtic elements in England, I have sometimes imitated the latter in my translation. Thus Bree, Combe (Coomb), Archet, and Chetwood are modelled on relics of British nomenclature, chosen according to sense: bree hill, chet "wood*. But only one personal name has been altered in this way. Meriadoc was chosen to fit the fact that this character's shortened name. Kali, meant in the Westron 'jolly, gay', though it was actually an abbreviation of the now unmeaning Buckland name Kalimac.
-- ibid
Older Hobbit names, and Rohirrim: OLD ENGLISH.
I have not used names of Hebraic or similar origin in my transpositions.
Nothing in Hobbit-names corresponds to this element in our names. Short names
such as Sam, Tom, Tim, Mat were common as abbreviations of actual Hobbit-names, such as Tomba, Tolma, Matta, and the like. But Sam and his father Ham were really called Ban and Ran. These were shortenings of Banazîr and Ranugad, originally nicknames, meaning 'half-wise, simple' and 'stay-at-home', but being words that had fallen out of colloquial use they remained as traditional names in certain families. I have therefore tried to preserve these features by using Samwise and Hamfast, modernizations of ancient English samwís and hámfoest which corresponded closely in meaning.
Having gone so far in my attempt to modernize and make familiar the
language and names of Hobbits, I found myself involved in a further process. The Mannish languages that were related to the Westron should, it seemed to me, be turned into forms related to English. The language of Rohan I have accordingly made to resemble ancient English, since it was related both (more distantly) to the Common Speech, and (very closely) to the former tongue of the northern Hobbits, and was in comparison with the Westron archaic. In the Red Book it is noted in several places that when Hobbits heard the speech of Rohan they recognized many words and felt the language to be akin to their own, so that it seemed absurd to leave the recorded names and words of the Rohirrim in a wholly alien style.
In several cases I have modernized the forms and spellings of place-names
in Rohan: as in Dunharrow or Snowbourne; but I have not been consistent, for I have followed the Hobbits. They altered the names that they heard in the same way, if they were made of elements mat they recognized, or if they resembled place-names in the Shire; but many they left alone, as I have done, for instance, in Edoras 'the courts'. For the same reasons a few personal names have also been modernized, as Shadowfax and Wormtongue.
This assimilation also provided a convenient way of representing the
peculiar local hobbit-words that were of northern origin. They have been given the forms that lost English words might well have had, if they had come down to our day. Thus mathom is meant to recall ancient English máthm, and so to represent the relationship of the actual Hobbit kast to R. kastu. Similarly smial (or smile) 'burrow' is a likely form for a descendant of smygel, and represents wen the relationship of Hobbit tran to R. trahan. Sméagol and Déagol are equivalents made up in the same way for the names Trahald 'burrowing, worming in', and Nahald 'secret' in the Northern tongues.
-- ibid
The language of Dale: NORSE.
The still more northerly language of Dale is in this book seen only in the
names of the Dwarves that came from that region and so used the language of the Men there, taking their 'outer' names in that tongue. I
-- ibid
This is only suggested in Appendix F ("still more northerly"), but it's made more explicit in "The Appendix on Languages" from HoME. It's also quite obvious just from looking at the Dwarven names: take Durin and Dwalin for examples.
In perusing the Appendices, I also found some relevant information earlier than Appendix F.
Quenya is based on LATIN.
In transcribing the ancient scripts I have tried to represent the original sounds (so far as they can be determined) with fair accuracy, and at the same time to produce words and names that do not look uncouth in modern letters. The High-elven Quenya has been spelt as much like Latin as its sounds allowed. For this reason c has been preferred to k in both Eldarin languages.
-- LotR, Appendix E "Writing and Spelling", Part I "Pronunciation of Words and Names"
Note that there's also a likening of Elvish languages to Latin and Greek in the above quotes from Appendix F. Occasional comparisons between them are scattered throughout the Appendices.
And finally, one more comparison (thanks to @heather for putting me onto this):
In summary, the languages we've seen referred to are English, Frankish, Gothic, Celtic, Old English, Norse, and Latin. All of these were used to inspire Middle-earth names, since the primary language of the story is English and names originating from other languages were required in order to maintain the illusion that the book is non-fiction translated from the Red Book of Westmarch. So Tolkien had to draw upon a bunch of other languages whose influence is often seen in English. Hebrew is the exception, just as Dwarvish is an exceptional language in Middle-Earth: only distantly related to any of the other languages mentioned.