In a charter dated 22 May 1467 James Ogilvy of Balgally and Inchmartine is noticed as the bastard son of Sir David Ogilvy of Inchmartine.
https://catalogue.nrscotland.gov.uk/nrsonlinecatalogue/details.aspx...
His father appears to have been lawfully married to a lady named Mariote Hay, from at least 30 April 1492 onwards until at least 29 September 1500, but it seems unlikely that she was the mother of a bastard son who may already have been of perfect age on 22 May 1467. See her profile overview Mariota Hay
Evidence for the name of his mother would be welcomed.