Is there a sprinkler that I can restrict to a small rectangular area between two buildings?

Yes, an oscillating sprinkler can be set so that it will direct water to a specific area. There are also pattern sprinklers.