1706, of persons, also style or appearance, carriage, etc., "debauched, disreputable, having the manners or appearance of a libertine or idle and dissolute person," from rake (n.2) + -ish. Related: Rakishly; rakishness.
The meaning "smart, jaunty, dashing" (1824), at first of ships, is said to be a different word, from nautical rake "slant, slope" (1620s), used of the projection of the upper part of a ship's hull at stem and stern beyond the extremities of the keel, later especially in reference to any deviation from the vertical in a ship's masts. That word is of uncertain origin, perhaps from Scandinavian (compare Old Swedish raka "project, reach;" Danish rage "protrude, project") related to Old English reccan "stretch." "The piratical craft of former times were distinguished for their rakish build" [Century Dictionary].