Update
Freestyle is natively supported in cycles as of this commit (will be in 2.72). This means that you can do exactly as in Utas's answer, but without the extra scene/renderlayer.
Original answer:
You could try using this node setup, it works with composite nodes and is render engine independent.
Here is an example render:
Here are some other methods I thought of:
Method one:
You can get outlines by using the index passes:
Enable the Material Index pass in Renderlayers > Passes:
Create a new material and set the Pass Index in Properties > Material > Settings:
Create the material:
You can then use the pass index to create an outline in compositing nodes:
Note that a limitation is that overlapping objects will not have lines between them:
This can be worked around by using the object Index for each object individually, however for large scenes this is probably too tedious.
Method two:
Another way is with the Filter node:
Repeat steps 1-3 from method one.
Enable the Normal pass in Render layers > Passes:
Use the normal pass to create lines, then limit the lines with the material index pass: (click for full size):
Result: