Thomas Bannatyne Gillies was born at Rothesay, on the Isle of Bute, Scotland, on 17 January 1828. He was the eldest of nine children of John Gillies, local lawyer and town clerk, and his wife, Isabella Lillie, daughter of a Glasgow businessman and grand-daughter of a Huguenot refugee. Both parents contracted typhus soon after Thomas's birth, and he spent his first five years at his grandfather's croft.
Educated at the parish school, Thomas planned to qualify as a mechanical engineer, but his father was determined that he should follow the law. Rebellious at first, Thomas agreed after several days of solitary confinement, appeals to his sense of duty as eldest son, and much prayer. After a four year clerkship with his father, he left Rothesay for Manchester and a commercial career, joining Robert Barbour and Sons. While in Manchester, he won a gold medal offered by the YMCA for scholarship. Thomas's next brother, John, took his place in his father's office. Soon after, the two planned to seek their fortune on the Californian goldfields. This project having been vetoed by their father, John left for Australia about 1850.
In Rothesay John Gillies senior had added a commitment to the new Free Church of Scotland to his law practice, official positions, personal business, and other duties. The weight of commitments affected his health, and he proposed that the family emigrate to the Free Church settlement in Dunedin, New Zealand. This being agreed to after much debate, Thomas Gillies married Catherine Douglas on 1 June 1852, at Newcastle upon Tyne, England, and on 24 July 1852 John and Isabella Gillies, with Thomas and Catherine, and five other offspring, sailed on the Slains Castle for New Zealand. Another daughter and, in time, John Gillies junior, from Australia, joined the family in New Zealand.
On arrival at Dunedin on 9 November 1852 John Gillies senior, with £1,000, and Thomas Gillies, with £300, bought 100 acres at Tokomairiro and 10 acres at Halfway Bush. The first property was farmed by Thomas and three of his brothers; the second provided a home for the remainder of the family. John Gillies senior resumed legal practice, joining John Hyde Harris in partnership, and began a political career.
In 1855 Thomas Gillies, differing with his father over plans to borrow and expand the Tokomairiro farm, bought a property at Warepa, building his own house there. A first son had been born at Tokomairiro, a second in 1856 at Warepa. But farm life stifled the intellectual side of Gillies. His time at Warepa included a position as enumerator in the Cultivation and Livestock Department, a task which took him through the southern district, and led to a series of articles, 'Pencillings by the way', in the Otago Witness. These showed him to have ideas extending well beyond his apparently contented rural existence.
Gillies felt concern, too, for the effect of pioneering farm life on his wife and children. In June 1857, on his father's appointment as sheriff and resident magistrate, he readily left Warepa, took his Bar examinations, and took over his father's partnership with Harris. In a thriving practice he was guaranteed at least £200 per year. He quickly showed sound judgement, a good knowledge of law, and skill in cross-examination. About 1861 he went into partnership with C. W. Richmond, and this lasted until Richmond went to the Bench in 1862. Gillies did not, however, lose his interest in farming, doing legal work for farmers.
Launched successfully in law, Gillies followed his father into politics, being elected to the Otago Provincial Council and the General Assembly in 1860. In the council he was briefly speaker in 1861. Choosing to pursue his political career through national politics, he was MHR for the county of Bruce from 1861 to 1864.
In Otago politics Gillies was a formidable figure, a ready controversialist, and a committed separationist. Joining Julius Vogel's championship of a separate South Island colony in the 1860s, Gillies found himself with strong local support, but it was always a minority cause in the Assembly. He introduced a bill, unsuccessfully, and in 1866 the issue finally died. Gillies opposed Otago superintendent James Macandrew to great effect in 1861, in an investigation of deficiencies in the public accounts. In 1862 he sat with Dillon Bell on a commission to adjust the public debt of Otago and Southland, following the creation in 1861 of Southland province.
In national politics Gillies served as attorney general in Alfred Domett's ministry in 1862, and as postmaster general and secretary of Crown lands in the succeeding Whitaker ministry of 1863–64. In the Domett ministry Gillies held office for only a brief period; in the Whitaker ministry he had little impact, being Dunedin-based and committed to spending most of his time there.
In 1865, out of government, and his wife, Catherine, having died on 25 February after childbirth, Thomas quit Dunedin for Auckland. With him went his four children and his youngest sister Bella; while they travelled by orthodox means, Thomas rode his horse for the entire overland journey between Dunedin and Auckland. In Auckland he re-entered legal practice, and married a second time, on 18 April 1867. His wife, Agnes Sinclair, was a niece of Andrew Sinclair, former colonial secretary; they had two children.
Returning to politics, on 18 November 1869 Gillies narrowly defeated John Williamson in a hard-fought campaign for the position of superintendent of Auckland province. In 1870 he re-entered the General Assembly as member for Mangonui, and then served as member for Auckland City West from 1871 to 1875. His vigorous opposition to Vogel's immigration and public works policies briefly brought him to office in Edward Stafford's short-lived 1872 ministry, in which he was colonial treasurer.
At the end of his term as superintendent in November 1873, Gillies did not seek re-election. In March 1875 he was appointed judge of the Supreme Court of New Zealand for the Auckland district, the first New Zealand judge to have qualified for admission to the Bar by New Zealand examination.
Agnes Gillies died on 2 March 1884. In her honour and that of her uncle, Thomas Gillies dedicated the Sinclair scholarship in zoology and botany and the Gillies scholarship in chemistry and physics, at Auckland University College. The scholarships reflected the scientific enthusiasms of his private life. In 1868, with Frederick Hutton and James Coutts Crawford, he helped found the Auckland Institute, of which he was president in 1869, 1873 and 1876. An enthusiast for conchology and many aspects of horticulture, he contributed many papers to the Transactions and Proceedings of the New Zealand Institute, a body of which he was a member. He was on the council of Auckland University College from its foundation in 1882 until his death. His collection of New Zealand shells, accumulated over many years, included those found during searches along the North Auckland coast, sometimes aided by Thomas Kirk. Gillies's interest in horticulture had practical applications. He worked to acclimatise trees and plants of economic value – successfully with cork-oak at Mt Eden, less so with sugar-producing plants.
Gillies was on leave for much of 1887 and 1888, during which time he revisited Britain. He died, still holding judicial office, at Auckland on 26 July 1889. As Auckland's only resident Supreme Court judge, he had earned a ready respect for handling a growing caseload, while regularly serving on the Court of Appeal. He was considered a sound judge, and his judgements, notable for their brevity, precision in reasoning, and clear analysis, were rarely overturned on appeal.