The expression in idiom dictionaries
Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013) notes the idiomatic usage that the poster asks about, but doesn't indicate a date of first known occurrence of this usage:
look the other way Deliberately overlook something, especially something of an illicit nature. For example, They're not really entitled to a discount but the sales manager decided to look the other way. This expression uses the other way in the sense of "away from what is normal or expected."
Ammer's reticence on the question of origin date may be due to the gradual emergence of the idiomatic usage from the more literal sense of "look the other way," which seems to have been in use for some time before the modern idiomatic form became entirely and recognizably distinctive.
Other idiom dictionaries have similar takes on the meaning of the phrase but say nothing about its origin Here re four examples. From Longman Dictionary of English Idioms (1979):
look the other way to pretend not to notice
From The Wordsworth Dictionary of Idioms (1982/1993):
look the other way to ignore or pretend not to notice something wrong, illegal, etc
From Cambridge International Dictionary of Idioms (1998):
look the other way to ignore something wrong or unpleasant that you know is happening instead of trying to deal with it
From Oxford Dictionary of English Idioms, third edition (2009):
look the other way deliberately ignore wrongdoing by others
Early examples of the expression in its modern idiomatic sense
Examples of the expression in its modern sense go back more than 100 years. For example, from Mark Twain, Following the Equator (1897):
The rabbit's natural enemy in England is the poacher; in Bluff [a region in New Zealand] its natural enemy is the stoat, the weasel, the ferret, the cat, and the mongoose. In England any person below the Heir who is caught with a rabbit in his possession must satisfactorily explain how it got there, or he will suffer fine and imprisonment, together with extinction of his peerage; in Bluff, the cat found with a rabbit in its possession does not have to explain—everybody looks the other way; the person caught noticing would suffer fine and and imprisonment, with extinction of peerage. This is a sure way to undermine the moral fabric of a cat.
From "Testimony of Mr. James Morton Langley, Representing the Merchants' Association of New York" (April 3, 1901), in Report of the [U.S.] Industrial Commission on Transportation (1901):
Q. (By Mr. RIPLEY.) Do they [freight inspectors] not have it in their power, if they were bribed or otherwise induced, to change the freight rates which parties pay?—A. Yes; and it is also possible for them to look the other way on occasion.
From W.C. Bagley, "Looking the Other Way," in School and Home Education (September 1912):
The mayor's letter [to a little girl promising that "the next time the policeman paced the beat, he would look the other way" when the girl and hr playmates rollerskated on the sidewalk in violation of a city ordinance] was published in the papers, and the people of that great city rejoiced that a man sat in the mayor's chair who could so easily cut the red tape and set aside foolish restriction upon individual liberty. The formula was a simple one: the police would look the other way.
The months of the mayor's administration slipped by, and the police continued to look the other way. There were laws against gambling which interfered with the pleasure of certain citizens. There were laws regulating the liquor traffic, and these laws when enforced permitted s citizen's thirst to remain unabated for as much as six hours. ... The policy of looking the other way removed at once these gross inequalities.
Early examples of the expression in a literal or figurative but non-idiomatic sense
But before instances of this type appear, we have numerous examples of literal looking away from something to avoid seeing it. For example, from Laurie Appleton, "She Stood Among the Roses," in Ballou's Monthly Magazine (October 1884):
Then her heart was beating wildly, / But she sternly said it "Nay!" / And she longed to meet his glances, / Yet she looked the other way.
And from "Follette" in Follette, and Other Stories (1881):
He longed for a nod of familiar recognition this morning; but, as if by tacit accord, everybody looked the other way when he passed, or else answered his greeting so coldly that it made any nearer approach impossible. He felt that he was tabooed, and strode on, whistling, his head in the air and his hands in his pockets, painfully conscious that the groups at the shop-doors suspended their gossip to pass a word of unfriendly comment as they looked after him.
And from "To Brighton and Back, Every Sunday, Three Shillings," in The Sunday Magazine (1865):
Nobody ought to turn their backs upon God, and look the other way. Nobody ought to go and seek pleasure. Nobody ought to go hurry-scurrying to Brighton and back on Sunday, whether it was a pound or three shillings or a sixpence or whatever it was.
This last example, of course, involves a figurative "turning one's back and looking the other way," but it is nevertheless an antecedent to the idiomatic sense of connivance at—of avoiding seeing and opposing—something improper or illegal.
The literal sense of "look the other way" implies an odd duality in looking—not simply one choice from among 360 degrees of looking, but a facing away at approximately 180 degrees from the proper view. A very early instance of the expression in this sense appears in "A Return of Prayer: or, A Faithful Relation of Some Remarkable Passages of Providence Concerning Thomas Sawdie, a Boy of Twelve Years of Age, Servant of Iohn Roberts of Trebitian in the Parish of Lawrack, and County of Cornwall" (1664):
Yet towards the close of that days Work, about a quarter of an hour before the end, the Devil told the Boy (as he since affirms) while he lay in his dead Fit, that if he would look the other way, and not in the Ministers face, he should open his eyes, and roar, and disturb them again, notwithstanding the Ministers hand which held his ; which he began to do, with mighty strugling, his face being turned away directly from the Ministers, even into the bosome of the man that held him on the other side of the Chair.
Evidently, "looking the other way" in the sense of looking in the opposite direction from the direction one should or would normally look goes back to the middle 1600s at least, but "looking the other way" in the sense of permissively overlooking or refusing to acknowledge something wrong or inappropriate seems to date only to the late 1800s.