Companies that are in related businesses but not direct competitors can and should recommend each other, provided you are confident in the other company's work. At a plumbing company where I used to work, the owner had actually worked out several deals with other companies. We would often get asked by customers if we knew a good electrician, HVAC company, landscaper, carpenter, etc. The boss actually gave each technician a printed list of company names to share with customers as "We at ________ Plumbing recommend ________ Electrical. We've done a lot of projects side by side with them and they're professional, knowledgeable, and fair."
The idea was that ____________ Electrical was saying the same about us when their customers would ask them for a plumbing recommendation. There was no sort of formal deal, commission, or kickback, just the mutual benefit of knowing that someone out there was spreading your name.
I'd recommend in your case exchanging a stack of business cards with your fellow business owner and having them ready in your work vehicle in case you're asked. Or even if you overhear Mrs. Homeowner remarking about how she'd love to replace that rickety old porch on the back of the house, that's a perfect opportunity to pipe up with "I know a carpenter who is very good. I can give you his card if you'd like to talk to him about pricing a job like that".
I also like HandyMillerMan's idea about just including the card with the literature that his Realtor friend would be giving to the customer anyway. That's a great idea in his situation.