Add pear, sugar, water, and rosemary for the simple syrup to a small saucepan. Bring the mixture to a boil, cooking until sugar is dissolved.
Remove from heat, cover, and let steep for 30 minutes. Strain the syrup into an airtight container and chill until at least room temperature before using.
Fill a mixing glass with ice. Add gin, syrup, and lemon juice, stirring to combine. Strain into a cocktail glass filled with ice.
Top the cocktail with tonic water and give a final stir.
Garnish and serve.