William Gilbert Gosling was born on 8 September 1863 at Paget, Bermuda, the son of Charles and Elizabeth (Gilbert) Gosling. On 22 June 1881 he came to St. John's to work as a clerk with the fish exporting firm of Harvey & Co., whose owners had had long commercial and family connections with Bermuda. The following year he met Armine Nutting, a native of Waterloo, Quebec and teacher at the Church of England Girls School. On 2 January 1888 they married and had two sons and two daughters.
Gosling is best remembered for his contributions to the public life of his adopted city. In 1902 he was Honourary Secretary of a fund raising committee for rebuilding part of the Anglican Cathedral, which had been destroyed in the 1892 fire. In 1908 he helped form the Association for the Prevention of Consumption and was its vice-president. Gosling was also an active member in the Newfoundland Historical Society and often participated in public debate with the Island's eminent historian, Judge Daniel W. Prowse, over various historical interpretations. He also found time to write two books. The first, published in 1910, was a history of Labrador; it stands to this day as the most comprehensive work on its subject. In 1911 he published a biography of the sixteenth century adventurer, Sir Humphrey Gilbert.
By 1913 Gosling, who was now a director of Harvey & Co. and President of the Newfoundland Board of Trade which he helped establish in 1909, had concentrated his interests on the urban and social problems of St. John's. In his deliberations, he was greatly influenced by the municipal reform movements in Canada and the United States and their emphases on administrative efficiency and social improvement. Using the prestige of his presidency, in December 1913 Gosling had the Board organize a Citizens' Committee to investigate municipal government and to ascertain what reforms could be effected in St. John's. The result was the legislature in 1914 replacing the elective city council by a 12-man appointed commission, which subsequently administered the city for two years and drafted a new municipal charter under Gosling's chairmanship. The legislature refused to pass this charter in 1916 and instead restored the elective form of city council. A civic election was held in June 1916 and Gosling was elected mayor. During his mayoralty, Gosling in 1917 succeeded in securing legislative authority for the city to provide public housing for its citizens and to have the city's taxation system revised. He also promoted the cause of child welfare and his personal and financial support led to the formation of the Child Welfare Association, established in 1921.
With the enactment in 1921 of the City Charter by the legislature - the basis of the present system of municipal government in St. John's - Gosling withdrew from civic life for both business and health reasons and retired to his native Bermuda, where he died at Paget on 5 November 1930. His wife later donated his extensive collection of books to the people of St. John's to form the basis of the city's first public library, which opened in 1936.